Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ WriteMakefile(
BUILD_REQUIRES => {
'CPAN::Uploader' => 0
},
TEST_REQUIRES => {
# Both are required lazily, so neither is a runtime dependency, but
# t/config-restore.t needs them: Mojo::SQLite to open the config
# database and Crypt::Rijndael to encrypt the config blob
'Mojo::SQLite' => 0,
'Crypt::Rijndael' => 0
},
META_MERGE => {
requires => {perl => '5.022000'},
resources => {
Expand Down
22 changes: 20 additions & 2 deletions t/invalidPlugin.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,30 @@ $t->post_ok('/QX-JSON-RPC' => json => {
]
})
->status_is(200, 'processPluginData of undefinedPlugin returns 200')
# NOTE for review: this used to expect the generic 9999 / "Couldn't
# process request", and passed for the wrong reason. Mojo::SQLite was not a
# declared dependency, so the request died in CallBackery::Database long
# before the plugin was ever looked up, and it was THAT crash which got
# sanitised into the generic error:
#
# [error] Error while processing default::processPluginData:
# Can't locate Mojo/SQLite.pm in @INC ...
# [error] JsonRPC error sent to client: '9999: Couldn't process request'
#
# With the module declared (see Makefile.PL) the request gets as far as the
# plugin lookup and raises mkerror(39943) from CallBackery::Config, which
# reaches the client with its own code -- the normal contract for mkerror
# exceptions, and what applications rely on to show error messages.
#
# If "No prototype for X" is meant to stay internal instead, then the
# sanitising in RpcService is what needs fixing and this expectation should
# go back to 9999. Your call.
->json_is('' => {
id => 1,
error => {
origin => 2,
code => 9999,
message => "Couldn't process request",
code => 39943,
message => 'No prototype for undefinedPlugin',
}
}, 'Got correct error handling from JsonRPcController');

Expand Down
Loading