File tree Expand file tree Collapse file tree 5 files changed +5
-8
lines changed
crates/bcr-ebill-wasm/src/api Expand file tree Collapse file tree 5 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 1
1
# 0.3.5
2
2
3
3
* Add in-depth tests for bill validation
4
+ * Properly propagate and log errors when getting a file (e.g. an avatar)
4
5
5
6
# 0.3.4
6
7
Original file line number Diff line number Diff line change @@ -104,8 +104,7 @@ impl Bill {
104
104
let file_bytes = get_ctx ( )
105
105
. bill_service
106
106
. open_and_decrypt_attached_file ( bill_id, file_name, & keys. private_key )
107
- . await
108
- . map_err ( |_| Error :: NotFound ) ?;
107
+ . await ?;
109
108
110
109
let content_type = detect_content_type_for_bytes ( & file_bytes)
111
110
. ok_or ( Error :: Validation ( ValidationError :: InvalidContentType ) ) ?;
Original file line number Diff line number Diff line change @@ -45,8 +45,7 @@ impl Company {
45
45
let file_bytes = get_ctx ( )
46
46
. company_service
47
47
. open_and_decrypt_file ( id, file_name, & private_key)
48
- . await
49
- . map_err ( |_| Error :: NotFound ) ?;
48
+ . await ?;
50
49
get_ctx ( ) . contact_service . get_contact ( id) . await ?; // check if contact exists
51
50
52
51
let content_type = detect_content_type_for_bytes ( & file_bytes)
Original file line number Diff line number Diff line change @@ -34,8 +34,7 @@ impl Contact {
34
34
let file_bytes = get_ctx ( )
35
35
. contact_service
36
36
. open_and_decrypt_file ( id, file_name, & private_key)
37
- . await
38
- . map_err ( |_| service:: Error :: NotFound ) ?;
37
+ . await ?;
39
38
40
39
let content_type = detect_content_type_for_bytes ( & file_bytes) . ok_or (
41
40
service:: Error :: Validation ( ValidationError :: InvalidContentType ) ,
Original file line number Diff line number Diff line change @@ -50,8 +50,7 @@ impl Identity {
50
50
let file_bytes = get_ctx ( )
51
51
. identity_service
52
52
. open_and_decrypt_file ( & id, file_name, & private_key)
53
- . await
54
- . map_err ( |_| Error :: NotFound ) ?;
53
+ . await ?;
55
54
56
55
let content_type = detect_content_type_for_bytes ( & file_bytes)
57
56
. ok_or ( Error :: Validation ( ValidationError :: InvalidContentType ) ) ?;
You can’t perform that action at this time.
0 commit comments