mirror of
https://github.com/uqbar-dao/nectar.git
synced 2025-01-06 09:32:26 +03:00
app_store: handling error responses
This commit is contained in:
parent
f704eb9521
commit
20af8cd17e
@ -55,6 +55,7 @@ interface downloads {
|
|||||||
http-client-error,
|
http-client-error,
|
||||||
blob-not-found,
|
blob-not-found,
|
||||||
vfs-error,
|
vfs-error,
|
||||||
|
handling-error(string),
|
||||||
}
|
}
|
||||||
|
|
||||||
record download-complete-request {
|
record download-complete-request {
|
||||||
@ -192,7 +193,6 @@ interface main {
|
|||||||
local(local-response),
|
local(local-response),
|
||||||
chain-error(chain-error),
|
chain-error(chain-error),
|
||||||
download-error(download-error),
|
download-error(download-error),
|
||||||
send-error(string),
|
|
||||||
handling-error(string),
|
handling-error(string),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,12 @@ fn init(our: Address) {
|
|||||||
}
|
}
|
||||||
Ok(message) => {
|
Ok(message) => {
|
||||||
if let Err(e) = handle_message(&our, &mut state, &mut http_server, &message) {
|
if let Err(e) = handle_message(&our, &mut state, &mut http_server, &message) {
|
||||||
print_to_terminal(1, &format!("main: error handling message: {e:?}"));
|
let error_message = format!("error handling message: {e:?}");
|
||||||
|
print_to_terminal(1, &error_message);
|
||||||
|
Response::new()
|
||||||
|
.body(AppStoreResponse::HandlingError(error_message))
|
||||||
|
.send()
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,14 @@ fn init(our: Address) {
|
|||||||
&mut tmp,
|
&mut tmp,
|
||||||
&mut auto_updates,
|
&mut auto_updates,
|
||||||
) {
|
) {
|
||||||
print_to_terminal(1, &format!("downloads: error handling message: {:?}", e));
|
let error_message = format!("error handling message: {e:?}");
|
||||||
|
print_to_terminal(1, &error_message);
|
||||||
|
Response::new()
|
||||||
|
.body(DownloadResponses::Err(DownloadError::HandlingError(
|
||||||
|
error_message,
|
||||||
|
)))
|
||||||
|
.send()
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user