From c7082ba36ec2e6b8fe9209db0944d69188db6250 Mon Sep 17 00:00:00 2001 From: Justin Borromeo Date: Wed, 27 Feb 2019 21:40:30 -0700 Subject: [PATCH] Added friendlier dsql error message for 405 (which occurs when druid.sql.enabled=false) (#7112) * Added friendlier error message for dsql 405 * no extra char * Changed error message * fixed weird spacing --- examples/bin/dsql-main | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/bin/dsql-main b/examples/bin/dsql-main index 8128931b9e7..d4f3fed511a 100755 --- a/examples/bin/dsql-main +++ b/examples/bin/dsql-main @@ -136,6 +136,10 @@ def raise_friendly_error(e): if error_obj['host']: error_text = error_text + ' (' + str(error_obj['host']) + ')' raise DruidSqlException(error_text) + elif e.code == 405: + error_text = 'HTTP Error {0}: {1}\n{2}'.format(e.code, e.reason + " - Are you using the correct broker URL and " +\ + "is druid.sql.enabled set to true on your broker?", text) + raise DruidSqlException(error_text) else: raise DruidSqlException("HTTP Error {0}: {1}\n{2}".format(e.code, e.reason, text)) else: