Skip to content

Commit e8b0651

Browse files
committed
custom error code
1 parent 9b58c1a commit e8b0651

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hyperapp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ thread_local! {
3737
pub struct HttpRequestContext {
3838
pub request: IncomingHttpRequest,
3939
pub response_headers: HashMap<String, String>,
40-
pub response_status: u16,
40+
pub response_status: http::StatusCode,
4141
}
4242

4343
pub struct AppContext {
@@ -97,7 +97,7 @@ pub fn add_response_header(key: String, value: String) {
9797
}
9898

9999
// Set the HTTP response status code
100-
pub fn set_response_status(status: u16) {
100+
pub fn set_response_status(status: http::StatusCode) {
101101
APP_HELPERS.with(|helpers| {
102102
if let Some(ctx) = &mut helpers.borrow_mut().current_http_context {
103103
ctx.response_status = status;

0 commit comments

Comments
 (0)