-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MIM-1536 Return error 404 instead of 500 if GET command not found #3383
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3383 +/- ##
==========================================
+ Coverage 80.72% 80.76% +0.03%
==========================================
Files 397 397
Lines 32268 32269 +1
==========================================
+ Hits 26049 26062 +13
+ Misses 6219 6207 -12
Continue to review full report at Codecov.
|
small_tests_24 / small_tests / 0f75db5 internal_mnesia_24 / internal_mnesia / 0f75db5 small_tests_23 / small_tests / 0f75db5 ldap_mnesia_24 / ldap_mnesia / 0f75db5 mod_event_pusher_rabbit_SUITE:group_chat_message_publish:group_chat_message_received_event_properly_formatted{error,
{{assertMatch,
[{module,mod_event_pusher_rabbit_SUITE},
{line,435},
{expression,
"get_decoded_message_from_rabbit ( AliceGroupChatMsgRecvRK )"},
{pattern,
"# { << \"from_user_id\" >> := BobRoomJID , << \"to_user_id\" >> := AliceFullJID , << \"message\" >> := Message }"},
{value,
#{<<"from_user_id">> =>
<<"muc_publish@muc.localhost/bOb_unnamed_37.452080">>,
<<"message">> => <<"Hi there!">>,
<<"to_user_id">> =>
<<"alice_unnamed_37.570246@localhost/res1">>}}]},
[{mod_event_pusher_rabbit_SUITE,
'-group_chat_message_received_event_properly_formatted/1-fun-1-',3,
[{file,
"/home/circleci/app/big_tests/tests/mod_event_pusher_rabbit_SUITE.erl"},
{line,435}]},
{escalus_story,story,4,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}} dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 0f75db5 dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 0f75db5 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 0f75db5 sm_SUITE:parallel:messages_are_properly_flushed_during_resumption_p1_fsm_old{error,
{{badmatch,
{error,
{connection_step_failed,
{#Fun<sm_SUITE.11.118723036>,
{client,
<<"alicE_messages_are_properly_flushed_during_resumption_p1_fsm_old_2.159194@domain.example.com">>,
escalus_tcp,<0.31687.1>,undefined,
[{username,
<<"alicE_messages_are_properly_flushed_during_resumption_p1_fsm_old_2.159194">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_management,true},
{stream_id,<<"968d0efd94b1f487">>}]},
[{compression,[<<"zlib">>]},
{starttls,true},
{stream_management,true},
{advanced_message_processing,true},
{client_state_indication,false},
{sasl_mechanisms,[<<"SCRAM-SHA-256">>,<<"PLAIN">>]},
{caps,undefined}]},
{timeout,get_resumed}}}},
[{sm_SUITE,
'-messages_are_properly_flushed_during_resumption_p1_fsm_old/1-fun-1-',
3,
[{file,"/home/circleci/app/big_tests/tests/sm_SUITE.erl"},
{line,1274}]},
{escalus_story,story,4,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_s... ldap_mnesia_23 / ldap_mnesia / 0f75db5 dynamic_domains_mysql_redis_24 / mysql_redis / 0f75db5 pgsql_mnesia_24 / pgsql_mnesia / 0f75db5 elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 0f75db5 mysql_redis_24 / mysql_redis / 0f75db5 pgsql_mnesia_23 / pgsql_mnesia / 0f75db5 mssql_mnesia_24 / odbc_mssql_mnesia / 0f75db5 mod_event_pusher_rabbit_SUITE:group_chat_message_publish:group_chat_message_received_event_properly_formatted{error,
{{assertMatch,
[{module,mod_event_pusher_rabbit_SUITE},
{line,435},
{expression,
"get_decoded_message_from_rabbit ( AliceGroupChatMsgRecvRK )"},
{pattern,
"# { << \"from_user_id\" >> := BobRoomJID , << \"to_user_id\" >> := AliceFullJID , << \"message\" >> := Message }"},
{value,
#{<<"from_user_id">> => <<"muc_publish@muc.localhost">>,
<<"message">> => <<>>,
<<"to_user_id">> =>
<<"alice_unnamed_46.42883@localhost/res1">>}}]},
[{mod_event_pusher_rabbit_SUITE,
'-group_chat_message_received_event_properly_formatted/1-fun-1-',3,
[{file,
"/home/circleci/app/big_tests/tests/mod_event_pusher_rabbit_SUITE.erl"},
{line,435}]},
{escalus_story,story,4,
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}} service_domain_db_SUITE:db:db_keeps_syncing_after_cluster_join{error,{test_case_failed,{[<<"example1.com">>],
[<<"example1.com">>,<<"example2.com">>]}}} service_domain_db_SUITE:db:rest_with_auth:rest_delete_domain_cleans_data_from_mam{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"bob_rest_delete_domain_cleans_data_from_mam_89.39192@example.org/res1">>,
escalus_tcp,<0.13323.2>,
[{event_manager,<0.13317.2>},
{server,<<"example.org">>},
{username,
<<"bob_rest_delete_domain_cleans_data_from_mam_89.39192">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.13317.2>},
{server,<<"example.org">>},
{username,
<<"bob_rest_delete_domain_cleans_data_from_mam_89.39192">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"bob_rest_delete_domain_cleans_data_from_mam_89.39192">>},
{server,<<"example.org">>},
{host,<<"localhost">>},
{port,5232},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,
<<"bob_rest_delete_domain_cleans_data_from_mam_89.39192">>},
{server,<<"example.org">>},
{host,<<"localhost">>},
{password,<<"makota3">>},
{port,5232},
{stream_id,<<"300f4161daba9f3a">>}]},
5000],
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{service_domain_db_SUITE,
'-rest_delete_domain_cleans_data_from_mam/1-fun-0-',5,
... service_domain_db_SUITE:db:rest_without_auth:rest_delete_domain_cleans_data_from_mam{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"bob_rest_delete_domain_cleans_data_from_mam_97.620843@example.org/res1">>,
escalus_tcp,<0.13960.2>,
[{event_manager,<0.13954.2>},
{server,<<"example.org">>},
{username,
<<"bob_rest_delete_domain_cleans_data_from_mam_97.620843">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.13954.2>},
{server,<<"example.org">>},
{username,
<<"bob_rest_delete_domain_cleans_data_from_mam_97.620843">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"bob_rest_delete_domain_cleans_data_from_mam_97.620843">>},
{server,<<"example.org">>},
{host,<<"localhost">>},
{port,5232},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,
<<"bob_rest_delete_domain_cleans_data_from_mam_97.620843">>},
{server,<<"example.org">>},
{host,<<"localhost">>},
{password,<<"makota3">>},
{port,5232},
{stream_id,<<"97d2e1f04f3008f7">>}]},
5000],
[{file,
"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{service_domain_db_SUITE,
'-rest_delete_domain_cleans_data_from_mam/1-fun-0-',5... riak_mnesia_24 / riak_mnesia / 0f75db5 mod_ping_SUITE:server_ping_kill:server_ping_pong{error,{{badmatch,[{[<<"localhost">>,mod_ping,ping_response],
{expected_diff,5},
{before_story,5},
{after_story,9}}]},
[{escalus_mongooseim,post_story_check_metrics,1,
[{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_mongooseim.erl"},
{line,74}]},
{escalus_mongooseim,maybe_check_metrics_post_story,1,
[{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_mongooseim.erl"},
{line,51}]},
{escalus_story,story,4,
[{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,75}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}} sm_SUITE:parallel_manual_ack_freq_1:resume_session_state_stop_c2s{error,{thrown,{timeout,msg}}} mssql_mnesia_24 / odbc_mssql_mnesia / 0f75db5 |
This is already done for POST commands though
0f75db5
to
a48a52e
Compare
small_tests_24 / small_tests / a48a52e internal_mnesia_24 / internal_mnesia / a48a52e small_tests_23 / small_tests / a48a52e ldap_mnesia_24 / ldap_mnesia / a48a52e dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / a48a52e ldap_mnesia_23 / ldap_mnesia / a48a52e dynamic_domains_mysql_redis_24 / mysql_redis / a48a52e mam_SUITE:rdbms_cache_prefs_cases:messages_filtered_when_prefs_default_policy_is_roster{error,{test_case_failed,"ASSERT EQUAL\n\tExpected []\n\tValue [ok]\n"}} dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / a48a52e dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / a48a52e elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / a48a52e mysql_redis_24 / mysql_redis / a48a52e pgsql_mnesia_24 / pgsql_mnesia / a48a52e pgsql_mnesia_23 / pgsql_mnesia / a48a52e mssql_mnesia_24 / odbc_mssql_mnesia / a48a52e riak_mnesia_24 / riak_mnesia / a48a52e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, easy and fine 👌🏽
This PR addresses MIM-1536
Proposed changes include:
non_existent_command_returns404
testcase :)This command:
curl -v "http://localhost:8088/api/contacts/"
should return error 404, not 500.
This command is a valid working command fyi:
curl -v "http://localhost:8088/api/contacts/alice@localhost"
It's already done for POST commands.