Comments (6)
You can check for errors with condition-case
. If the websocket cannot connect, re-opening with websocket-open
seems like the safest thing to do.
from emacs-websocket.
Can you try this piece of code?
aria2c --enable-rpc --rpc-listen-port=6800
(condition-case _ (setq ws (websocket-open "ws://localhost:6800/unreachable)) (message "Error!"))
The condition-case
won't work because you can connect to the server but you will get 404 response because unreachable
doesn't exist, You will get
error in process filter: condition-case: Error response received from websocket server
error in process filter: Error response received from websocket server
The error was raised by websocket-outer-filter
at https://github.com/ahyatt/emacs-websocket/blob/master/websocket.el#L789 asynchronously.
IMO, it shuold be possible to handle these errors by using callback, force throwing errors is not so user-friendly.
from emacs-websocket.
I see - yeah that's a problem. After some investigation, I have a potential fix in the new error-fix
branch: 0591322. With this, you should be able to handle an error in whatever you set to on-error. I'm not sure this fix is complete good - it probably should throw if on-error is not set. I'll have to think about that case...
In any case, please try this out and let me know if the solution works for you.
from emacs-websocket.
Thanks you, this works for me.
It seems that default error-handler is websocket-default-error-handler
, why not just throw the error in that function?
from emacs-websocket.
Cool, this has been merged into the master branch, along with some other error issues I noticed.
from emacs-websocket.
thx for your work
from emacs-websocket.
Related Issues (20)
- websocket-frame-text error HOT 1
- Add release tags HOT 3
- Custom headers in handshake HOT 4
- A single message ws.send(data); comes in as two messages HOT 5
- Speed feedback HOT 10
- Randomly losing connections under emacs-ipython-notebook with version 1.11 HOT 5
- Error (websocket): in callback `on-message': JSON readtable error HOT 4
- Setting case-fold-search to nil results "Incorrect handhake from websocket" error HOT 7
- declares GPL-3+, but provided full-text license is GPL-2+ HOT 3
- Please tag a 1.12 release HOT 1
- Please consider adapting websocket-functional-test.el to use ert-deftest HOT 12
- TLSv1.3 HOT 1
- Branch rename breaks package installation HOT 6
- websocket-test.el: βfletβ is an obsolete macro (as of [emacs] 24.3) HOT 3
- websocket-to-bytes signal type error HOT 8
- Support connecting through proxies HOT 7
- infinite failure loop - emacs locked up HOT 18
- error 403 with ein over proxy HOT 14
- Push to ELPA? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emacs-websocket.