Skip to content

Commit f35b64e

Browse files
shimamotoxerial
andauthored
airframe-http: Add a method for storing server exceptions: TLS_KEY_SERVER_EXCEPTION (#1351)
* Add setThreadLocal method for the pre-defined key TLS_KEY_SERVER_EXCEPTION * Update HttpBackend.scala Co-authored-by: Taro L. Saito <leo@xerial.org>
1 parent 2a9979e commit f35b64e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

airframe-http/src/main/scala/wvlet/airframe/http/HttpBackend.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ trait HttpBackend[Req, Resp, F[_]] { self =>
6565
// Prepare a thread-local holder for passing parameter values
6666
def withThreadLocalStore(request: => F[Resp]): F[Resp]
6767

68+
// Set a thread-local context parameter value for a pre-defined key
69+
def setThreadLocalServerException[A](value: A): Unit = setThreadLocal(HttpBackend.TLS_KEY_SERVER_EXCEPTION, value)
70+
6871
// Set a thread-local context parameter value
6972
def setThreadLocal[A](key: String, value: A): Unit
7073

0 commit comments

Comments
 (0)