Commit Graph

31 Commits

Author SHA1 Message Date
Flori 64feb91680 License change (#477) 2024-01-31 23:59:42 +01:00
Dirk Stolle c5bfac66e5 Fix a few typos (#471) 2024-01-31 22:27:53 +01:00
bitfl0wer b8ba92cf07 Include license header everywhere 2024-01-30 17:19:34 +01:00
bitfl0wer 9bec639634 clean up imports 2023-12-03 12:51:34 +01:00
bitfl0wer 99155d1e5b impl From reqwest::Error for ChorusError 2023-12-03 12:49:07 +01:00
bitfl0wer db533f9700 Make Errors Hash and Eq, bump version 2023-09-03 16:55:19 +02:00
bitfl0wer 6e136fba83 Make ChorusError Clone 2023-09-01 01:17:23 +02:00
kozabrada123 141dc32819 Error observer (also merge perpetual/gateway-dev) (#425)
* Add Webrtc Identify & Ready

* Test error observer

* Minor updates

* More derives

* Even more derives

* Small types update

* e
2023-08-29 16:38:26 +00:00
bitfl0wer 2f9936cfd2 Add rustdoc comments 2023-08-26 19:41:00 +02:00
Flori 69b7c2445c Ratelimiter overhaul (#144)
* Rename limits and limit to have better names

* Remove empty lines

* Remove handle_request (moved to requestlimiter)

* Start working on new ratelimiter

* Make limits Option, add "limited?" to constructor

* Add missing logic to send_request

* Rename Limits

* Create Ratelimits and Limit Struct

* Define Limit

* Import Ratelimits

* Define get_rate_limits

* Remove unused import

* + check_rate_limits & limits_config_to_ratelimits

* Remove Absolute Limits
These limits are not meant to be tracked anyways.

* add ratelimits is_exhausted

* Add error handling and send request checking

* change limits to option ratelimits

* Add strum

* Change Ratelimits to Hashmap

* Remove ratelimits in favor of hashmap

* Change code from struct to hashmap

* start working on update rate limits

* Remove wrong import

* Rename ChorusLibError to ChorusError

* Documented the chorus errors

* Made error documentation docstring

* Make ReceivedErrorCodeError have error string

* Remove unneeded import

* Match changes in errors.rs

* Improve update_rate_limits and can_send_request

* add ratelimits.to_hash_map()

* use instances' client instead of new client

* add LimitsConfiguration to instance

* improve update_limits, change a method name

* Fix un-updated errors

* Get LimitConfiguration in a sane way

* Move common.rs into ratelimiter::ChorusRequest

* Delete common.rs

* Make instance.rs use overhauled errors

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* update ratelimiter implementation across all files

* Fix remaining errors post-refactor

* Changed Enum case to be correct

* Use result

* Re-add missing body to request

* Remove unneeded late initalization

* Change visibility from pub to pub(crate)
I feel like these core methods don't need to be exposed as public API.

* Remove unnecessary import

* Fix clippy warnings

* Add docstring

* Change Error names across all files

* Update Cargo.toml

Strum is not needed

* Update ratelimits.rs

* Update ratelimits.rs

* Bug/discord instance info unavailable (#146)

* Change text to be more ambigous

* Use default Configuration instead of erroring out

* Emit warning log if instance config cant be gotten

* Remove import

* Update src/instance.rs

Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>

* Add missing closing bracket

* Put limits and limits_configuration as one struct

* Derive Hash

* remove import

* rename limits and limits_configuration

* Save clone call

* Change LimitsConfiguration to RateLimits
`LimitsConfiguration` is in no way related to whether the instance has API rate limits enabled or not. Therefore, it has been replaced with what it should have been all along.

* Add ensure_limit_in_map(), add `window` to `Limit`

* Remove unneeded var

* Remove import

* Clean up unneeded things
Dead code warnings have been supressed, but flagged as FIXME so they don't get forgotten. Anyone using tools like TODO Tree in VSCode can still see that they are there, however, they will not be shown as warnings anymore

* Remove nested submodule `limit`

* Add doc comments

* Add more doc comments

* Add some log messages to some methods

---------

Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>
2023-07-09 18:38:02 +02:00
Vincent Junge f98180cd03 ChorusResult type alias 2023-06-21 21:39:22 +02:00
Flori Weber fa524b1791 Fix errors not displayed, add InvalidArgumentsErr 2023-06-18 23:01:38 +02:00
kozabrada123 10617ca85c Rebase 2023-06-09 18:14:20 +02:00
bitfl0wer 951e41db4b Add FormCreationError 2023-06-08 22:26:08 +02:00
bitfl0wer b0a19faa48 Change InstanceServerError to ChorusLibError
The name InstanceServerError was chosen without thinking about it too much, very early in development. The new name suits this custom Error type way better, in my opinion.
2023-06-08 22:16:23 +02:00
kozabrada123 a0629bf198 Gateway basic error handling 2023-06-08 17:34:52 +02:00
bitfl0wer 8e8556ee53 Add InvalidResponseError 2023-05-28 23:04:02 +02:00
bitfl0wer a1397cf46f Add PasswordRequiredError 2023-05-16 15:58:51 +02:00
bitfl0wer 833c3733d7 Add guild delete route 2023-05-14 14:16:21 +02:00
bitfl0wer d797a10009 Add RateLimit information 2023-05-14 13:12:02 +02:00
bitfl0wer 598ad093a1 Improve error handling on request sending 2023-05-14 13:07:46 +02:00
bitfl0wer fe63d11055 cool i have written a memory hog 2023-05-11 00:06:13 +02:00
bitfl0wer caafb9a620 Add error type for Observers 2023-04-27 22:38:57 +02:00
bitfl0wer 48333cf854 Make send_request return Result 2023-04-23 13:58:17 +02:00
bitfl0wer 1bdf202745 Register function with good errors! 2023-04-22 22:12:56 +02:00
bitfl0wer c6ded56510 push progress 2023-04-22 11:32:44 +02:00
bitfl0wer 752c885c10 Remove boilerplate errors 2023-04-21 23:20:23 +02:00
bitfl0wer d8b06921b6 add error 2023-04-21 18:20:49 +02:00
bitfl0wer 06bc2955a3 Move custom errros to central file 2023-04-21 16:18:20 +02:00
bitfl0wer 1c2a60613b Replace Custom Error boilerplate with macro 2023-04-21 15:04:58 +02:00
bitfl0wer 92afaccf33 create errors.rs 2023-04-21 14:30:10 +02:00