File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ const demo = new Elysia()
2828 })
2929 .get (' /throw' , ({ status }) => {
3030 // This will be caught by onError
31- throw status (418 )
31+ throw status (418 ) // or status("I'm a teapot")
3232 })
3333 .get (' /return' , ({ status }) => {
3434 // This will NOT be caught by onError
35- return status (418 )
35+ return status (418 ) // or status("I'm a teapot")
3636 })
3737</script >
3838
Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ const demo = new Elysia()
2828 })
2929 .get (' /throw' , ({ error }) => {
3030 // This will be caught by onError
31- throw error (418 )
31+ throw error (418 ) // or error("I'm a teapot")
3232 })
3333 .get (' /return' , ({ status }) => {
3434 // This will NOT be caught by onError
35- return status (418 )
35+ return status (418 ) // or status("I'm a teapot")
3636 })
3737
3838const demo2 = new Elysia ()
@@ -300,11 +300,11 @@ new Elysia()
300300 })
301301 .get (' /throw' , ({ status }) => {
302302 // This will be caught by onError
303- throw status (418 )
303+ throw status (418 ) // or status("I'm a teapot")
304304 })
305305 .get (' /return' , ({ status }) => {
306306 // This will NOT be caught by onError
307- return status (418 )
307+ return status (418 ) // or status("I'm a teapot")
308308 })
309309```
310310
You can’t perform that action at this time.
0 commit comments