Replies: 2 comments 3 replies
-
I'm guessing that this implementation for
might be safer, even if I cannot explain why |
Beta Was this translation helpful? Give feedback.
3 replies
-
Context sensitivity issue addressed by #2052 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the documentation for
Mojo::Transaction::WebSocket
underjson
we seeThe implementation uses
j
fromMojo::JSON
which should return undef if JSON decoding fails.But if the WS payload coming in is not parseable JSON the callback gives the error
Too few arguments for subroutine
or similar.The issue does not seem to have anything to do with
Mojo::Transaction::WebSocket
but rather withj
Here is a test file that emulates the problem.
this fails with too few arguments on the third and forth item. The method test2 emulates what
j
ends up doing.I'm not 100% sure what is going wrong here. I'm just writing this to note that it is misleading for the documentation to state that users should use signatures on the
json
callback when this fails if thejson
data cannot be parsed bydecode_json
.Beta Was this translation helpful? Give feedback.
All reactions