Comments (2)
Thanks for the report! I'm partial to the second option - moving away from Jason.decode!/2
and using the non-banged version. I'm not sure what the flow for this would look like though. If we encounter this error, what do we do about it?
from nostrum.
Yeah, I'm not sure. It's probably entirely reasonable to still just raise an exception and die, just with a more helpful message (like Got a "502 Bad Gateway" response with a non-JSON payload
) to make it clear what's happening.
Having the Ratelimiter
die will also mean that anyone who is currently issuing an API call will also raise an exception (and probably die, and hopefully be resurrected by their supervisor tree). That also seems good to me — I imagine you don't really want an API outage to be reported as an {:error, %Nostrum.Error.ApiError{...}}
tuple, because that's for actual API errors, with defined behaviour. We're very much in the realm of undefined behaviour here, which is what exceptions are for, I think.
from nostrum.
Related Issues (20)
- Memory optimizations: User struct HOT 1
- Documentation improvement: Message nonce HOT 1
- Documentation improvement: Add "Purpose" section to Nostrum.Shard.Supervisor
- Feature planning: Distributed sharding
- Feature planning: Distributed ratelimiting
- Remove usage of token from environment in Nostrum.Shard.Payload
- Remove usage of token from environment in Nostrum.Api.Base
- Remove Nostrum.Api.get_token
- Remove usage of num_shards setting from Nostrum.Util
- Feature planning: Reducing reliance on globally registered name
- Feature planning: QLC expansion
- Investigate unmatched returns found by Dialyzer
- State documentation uses outdated example for user discriminator query HOT 3
- Documentation Cheat Sheets HOT 1
- Cache Adapters & QLC: Example Postgres Adapter
- Expanding the example bot section HOT 6
- Provide friendlier message for missing consumer startup
- Include installing a consumer as part of the setup instructions
- Feature planning: Behaviours HOT 2
- Update documentation in regards to wrap_qlc
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 nostrum.