Skip to content

Commit 06dea53

Browse files
committed
Improve exception message
1 parent d69f7ae commit 06dea53

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/aleph/http/common.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
ssl-context)
195195
(if (= [:http1] desired-http-versions)
196196
ssl-context
197-
(throw (ex-info "No ALPN supplied, but requested non-HTTP/1 versions that require ALPN."
197+
(throw (ex-info "Supplied SslContext with no ALPN config, but requested secure non-HTTP/1 versions that require ALPN."
198198
{:desired-http-versions desired-http-versions}))))))
199199

200200
(defn validate-http1-pipeline-transform

test/aleph/http_test.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,7 @@
14291429
{:http-versions [:http2 :http1]
14301430
:ssl-context test-ssl/server-ssl-context})]
14311431
(is (instance? ExceptionInfo result))
1432-
(is (= "No ALPN supplied, but requested non-HTTP/1 versions that require ALPN." (ex-message result)))))
1432+
(is (= "Supplied SslContext with no ALPN config, but requested secure non-HTTP/1 versions that require ALPN." (ex-message result)))))
14331433

14341434
(testing "with no ALPN config but desiring only HTTP/1"
14351435
(let [result (try-start-server
@@ -1583,7 +1583,7 @@
15831583
{:http-versions [:http2 :http1]
15841584
:ssl-context test-ssl/client-ssl-context}})]
15851585
(is (instance? ExceptionInfo result))
1586-
(is (= "No ALPN supplied, but requested non-HTTP/1 versions that require ALPN." (ex-message result)))))
1586+
(is (= "Supplied SslContext with no ALPN config, but requested secure non-HTTP/1 versions that require ALPN." (ex-message result)))))
15871587

15881588
(testing "with no ALPN config but desiring only HTTP/1"
15891589
(let [result (try-request-with-pool

0 commit comments

Comments
 (0)