diff options
| author | Yigit Sever | 2021-04-13 20:37:54 +0300 |
|---|---|---|
| committer | Yigit Sever | 2021-04-13 20:37:54 +0300 |
| commit | 23e4f52284ad5fa0b068220c54a255ff9fa7b18f (patch) | |
| tree | 627671c12ea45f8a516601141e52005803384d47 /src/custom_filters.rs | |
| parent | b16da2c2b64f753129bb33b734a7982e2622ddd3 (diff) | |
| download | gradecoin-23e4f52284ad5fa0b068220c54a255ff9fa7b18f.tar.gz gradecoin-23e4f52284ad5fa0b068220c54a255ff9fa7b18f.tar.bz2 gradecoin-23e4f52284ad5fa0b068220c54a255ff9fa7b18f.zip | |
Add verbose error messages
Not happy with the solution one bit but using error.rs at
https://blog.logrocket.com/create-an-async-crud-web-service-in-rust-with-warp/
was not working
Basically we just handcraft every single response on the spot, there is
some repetition and it's ugly but need to move on
Diffstat (limited to 'src/custom_filters.rs')
| -rw-r--r-- | src/custom_filters.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/custom_filters.rs b/src/custom_filters.rs index dfdae04..ae8a56c 100644 --- a/src/custom_filters.rs +++ b/src/custom_filters.rs | |||
| @@ -28,7 +28,7 @@ pub fn transaction_json_body() -> impl Filter<Extract = (Transaction,), Error = | |||
| 28 | /// Used in Authorization for `Block` and `Transaction` proposals | 28 | /// Used in Authorization for `Block` and `Transaction` proposals |
| 29 | /// Rejects the request if the Authorization header does not exist | 29 | /// Rejects the request if the Authorization header does not exist |
| 30 | pub fn auth_header() -> impl Filter<Extract = (String,), Error = Rejection> + Clone { | 30 | pub fn auth_header() -> impl Filter<Extract = (String,), Error = Rejection> + Clone { |
| 31 | warp::header::header::<String>("Authorization") | 31 | warp::header::<String>("Authorization") |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | /// Extracts an `Block` JSON body from the request | 34 | /// Extracts an `Block` JSON body from the request |
