fixes
This commit is contained in:
@@ -489,7 +489,7 @@ fn reject(headers: &HeaderMap, message: String) -> Response {
|
||||
/// pattern a value does not satisfy — is the user's to fix and answers 422;
|
||||
/// only an actually unreachable backend answers 502.
|
||||
fn grpc_error(headers: &HeaderMap, error: &tonic::Status) -> Response {
|
||||
crate::ui::FormError::from_status(error)
|
||||
crate::ui::FormError::from_status_with_message(error, format!("{error:?}"))
|
||||
.into_response(Locale::from_headers(headers), ui::render_error)
|
||||
}
|
||||
|
||||
@@ -509,13 +509,14 @@ fn import_error(
|
||||
return failure.into_response(locale, ui::render_error);
|
||||
}
|
||||
let status = failure.status_code();
|
||||
let backend_error = format!("{error:?}");
|
||||
let message = ui::render_import_failure(
|
||||
locale,
|
||||
inserted_before_chunk + inserted_in_chunk,
|
||||
prepared_rows,
|
||||
// One header row precedes the data, and CSV rows are one-based.
|
||||
chunk_start + failed_row_index + 2,
|
||||
failure.message(),
|
||||
&backend_error,
|
||||
);
|
||||
(status, Html(message)).into_response()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user