Skip to content

Commit 3394144

Browse files
authored
fix: do not repeat error code in query call reject message (dfinity#3465)
This PR uses the user error description as the reject message for query calls to make the query call reject message matches the reject message for ingress message produced [here](https://github.com/dfinity/ic/blob/85af5fc7b9963f10bb6fd30d7929814501d783c7/rs/canonical_state/src/lazy_tree_conversion.rs#L517). Using the `Display` implementation of `UserError` instead of the description [repeats](https://github.com/dfinity/ic/blob/85af5fc7b9963f10bb6fd30d7929814501d783c7/rs/types/error_types/src/lib.rs#L462) the error code in the reject message while the error code is also available as a [separate](https://github.com/dfinity/ic/blob/85af5fc7b9963f10bb6fd30d7929814501d783c7/rs/http_endpoints/public/src/query.rs#L235) field in the query call reject response.
1 parent ca3b684 commit 3394144

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rs/http_endpoints/public/src/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ pub(crate) async fn query(
234234
Err(user_error) => HttpQueryResponse::Rejected {
235235
error_code: user_error.code().to_string(),
236236
reject_code: user_error.reject_code() as u64,
237-
reject_message: user_error.to_string(),
237+
reject_message: user_error.description().to_string(),
238238
},
239239
};
240240

0 commit comments

Comments
 (0)