Comments (5)
Yeah I just started noticing that too. It is because I didn't realise fetch
will still resolve even if the http status is an error. I guess I may have to check the status codes in my micropub library
from omnibear.
Yeah, fetch only "fails" if the network request itself actually fails. You have to handle HTTP response codes separately. Make sure the micropub library exposes the response code somehow, so I can distinguish 500 codes from 400 codes.
from omnibear.
Ok I have a new version of the micropub-helper
library up on npm (1.2.1)
In this version it will throw errors if the endpoint doesn't return a 2xx status code.
Errors now come as objects like this:
{
message: 'Human readable string',
status: null or the http status code,
error: null or further error information,
}
So you will be able to read if err.status
is a 400 or 500 and do whatever you want.
Just let me know if you run into any problems or have questions.
from omnibear.
So the micropub-helper
update means that this will default to being an error and omnibear will flash the error message
from omnibear.
Marking this resolved. I believe it's working now.
from omnibear.
Related Issues (20)
- Space separated tags not appropriate for WordPress multi-word tags
- Reply To is not cached
- URLs containing `@` are not not replied to correctly
- Add h-x-app information
- Can't create a bookmark without content
- Syndication targets are fetched even when token fetch failed
- Omnibear errors when auth error happens HOT 1
- Release new version with updated micropub-helper lib HOT 1
- Old syndication targets not cleared when logging out.
- After logging out and back in, reply-to page is set to Omnibear authentication page....
- omnibear mangles mastodon uriβs https://pdx.social/@dejus/101744380498713295 -> https://dejus/101744380498713295 HOT 1
- Add "clear draft" button
- Switch from localStorage to storage API
- Consider adding a sidebar action to the Firefox extension
- Omnibear is not available on addons.mozilla.org anymore HOT 6
- omnibear.com should have an h-app
- Stopped working HOT 1
- Upgrade dependencies HOT 1
- Stays on login screen in sidebar after authenticating
- Upgrade to web manifest v3 HOT 1
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 omnibear.