-
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
Return error IQ when SQL query execution fails #4308
Conversation
elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 462890f small_tests_25 / small_tests / 462890f small_tests_26 / small_tests / 462890f small_tests_26_arm64 / small_tests / 462890f ldap_mnesia_25 / ldap_mnesia / 462890f ldap_mnesia_26 / ldap_mnesia / 462890f dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 462890f dynamic_domains_mysql_redis_26 / mysql_redis / 462890f dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 462890f dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 462890f internal_mnesia_26 / internal_mnesia / 462890f pgsql_cets_26 / pgsql_cets / 462890f pgsql_mnesia_25 / pgsql_mnesia / 462890f mysql_redis_26 / mysql_redis / 462890f pgsql_mnesia_26 / pgsql_mnesia / 462890f carboncopy_SUITE:one2one:dropped_client_doesnt_create_duplicate_carbons{error,
{{badmatch,
[{xmlel,<<"message">>,
[{<<"from">>,
<<"alice_dropped_client_doesnt_create_duplicate_carbons_605@localhost">>},
{<<"to">>,
<<"alice_dropped_client_doesnt_create_duplicate_carbons_605@localhost/res2">>},
{<<"xmlns">>,<<"jabber:client">>},
{<<"type">>,<<"chat">>}],
[{xmlel,<<"sent">>,
[{<<"xmlns">>,<<"urn:xmpp:carbons:2">>}],
[{xmlel,<<"forwarded">>,
[{<<"xmlns">>,<<"urn:xmpp:forward:0">>}],
[{xmlel,<<"message">>,
[{<<"from">>,
<<"alice_dropped_client_doesnt_create_duplicate_carbons_605@localhost/res1">>},
{<<"type">>,<<"chat">>},
{<<"to">>,
<<"bob_dropped_client_doesnt_create_duplicate_carbons_605@localhost/res1">>},
{<<"xmlns">>,<<"jabber:client">>}],
[{xmlel,<<"body">>,[],
[{xmlcdata,
<<"And pious action">>}]}]}]}]}]}]},
[{carboncopy_SUITE,
'-dropped_client_doesnt_create_duplicate_carbons/1-fun-0-',4,
[{file,
"/home/circleci/project/big_tests/tests/carboncopy_SUITE.erl"},
{line,189}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
{test_server,run_test_case_eval1,6,
[{file,"test_serv... mssql_mnesia_26 / odbc_mssql_mnesia / 462890f pgsql_mnesia_26 / pgsql_mnesia / 462890f |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4308 +/- ##
==========================================
+ Coverage 84.27% 84.31% +0.03%
==========================================
Files 553 553
Lines 33720 33724 +4
==========================================
+ Hits 28418 28434 +16
+ Misses 5302 5290 -12 ☔ View full report in Codecov by Sentry. |
big_tests/tests/mam_SUITE.erl
Outdated
mam_helper:wait_for_archive_size(Alice, 1), | ||
when_archive_query_is_sent(Alice, undefined, Config), | ||
Res = escalus:wait_for_stanza(Alice), | ||
escalus:assert(is_iq_error, Res) |
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.
Could also add something like this to check the error type:
escalus:assert(is_error, [<<"cancel">>, <<"service-unavailable">>], Error)
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.
looks ok
This comment was marked as outdated.
This comment was marked as outdated.
38a2b29
to
35dfa47
Compare
elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 35dfa47 small_tests_25 / small_tests / 35dfa47 small_tests_26 / small_tests / 35dfa47 small_tests_26_arm64 / small_tests / 35dfa47 ldap_mnesia_25 / ldap_mnesia / 35dfa47 ldap_mnesia_26 / ldap_mnesia / 35dfa47 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 35dfa47 dynamic_domains_mysql_redis_26 / mysql_redis / 35dfa47 dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 35dfa47 pgsql_cets_26 / pgsql_cets / 35dfa47 internal_mnesia_26 / internal_mnesia / 35dfa47 dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 35dfa47 mysql_redis_26 / mysql_redis / 35dfa47 pgsql_mnesia_26 / pgsql_mnesia / 35dfa47 pgsql_mnesia_25 / pgsql_mnesia / 35dfa47 mssql_mnesia_26 / odbc_mssql_mnesia / 35dfa47 |
This PR changes the server response when a prepared SQL query fails to run. Now, it will respond with a 500 error instead of an empty result set.
The
try ... catch ...
block around the entire lookup function simplifies the logic for returning errors. This ensures that any error during the function's execution is caught and handled properly in one place.