-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle_frame swallowing exception? #51
Comments
It does catch them so that it can run terminate. Are you manually exiting out of terminate? |
Ah, that's probably it - this module hasn't defined Line 304 in cb615af
I don't see any error handling here - somewhere between |
That is the expected behavior. If you haven't defined There's nothing that's written to logger explicitly like Here's the test for it. websockex/test/websockex_test.exs Lines 779 to 786 in cb615af
I'll try to reproduce it in a bit, but since the test passed I'm wondering if it's something else in the way that they should be reported that I am missing. |
Let me know if you're unable to reproduce and I'll put together a minimal broken example. |
Could you clarify what this means? The process is definitely crashing, the crash is caught by a supervisor which restarts the process. If the crash is being properly raised (including stacktrace), what's unexpected is the lack of logging. From my perspective as a consumer of the library, a quiet crash makes debugging extremely difficult and counterintuitive. For example, it took me about an hour to realize I'd made a mistake in how I was using Poison to decode a response in |
Yes, the supervisor is "eating" the exit and I agree that a logging mechanism is definitely necessary. Normally OTP would receive those exits and create some kind of message. GenServer gets around that limitation by using The problem for me is that there are some libraries that depend on In the interim as a workaround, you can do something like: def terminate({exception, stacktrace}, state) do
if Exception.exception?(exception) do
require Logger
Logger.error fn -> Exception.format(:error, exception, stacktrace) end
end
:ok
end
def terminate(_,_), do: :ok That(#30) and SSL connections(#1) are why it's not 1.0 release yet. |
This was really tripping me up. I couldn't figure out why a process I had linked to my socket kept getting a new pid. I'd recommend putting this logging in as the default behavior until this can be properly addressed as you desire. |
If something unexpected happens in handle_frame, the exception is completely swallowed - the process crashes but nothing is logged to the console.
The text was updated successfully, but these errors were encountered: