Skip to content

ctx.assert(false, 401, "foo") === ctx.throw("foo", 401) ? #1674

Answered by miwnwski
SimonAM asked this question in Q&A
Discussion options

You must be logged in to vote

Assert only throws an exception if the statement is falsy, while throw always throws an exception on call. These concepts are translated from traditional assert and throw semantics. If you still feel these are unclear, maybe PR a change and people can review it? Subjectively I don't think it's unclear, because I assume the purpose of assert and throw is commonly known, but maybe I'm wrong or misunderstand the issue?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by miwnwski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants