diff options
author | crupest <crupest@outlook.com> | 2022-12-18 20:07:29 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-12-20 20:32:53 +0800 |
commit | 2efc4f7ea0784a504ce50207a19a8899a121f8cd (patch) | |
tree | 705eac7dd02e4335816a4b048b1b14d08cea24a4 /docker/crupest-api/CrupestApi/CrupestApi.Commons/Error.cs | |
parent | 8b7bbe2b70f25bc493bf11bd4d0e484e65d22523 (diff) | |
download | crupest-2efc4f7ea0784a504ce50207a19a8899a121f8cd.tar.gz crupest-2efc4f7ea0784a504ce50207a19a8899a121f8cd.tar.bz2 crupest-2efc4f7ea0784a504ce50207a19a8899a121f8cd.zip |
Develop secret api. v42
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Error.cs')
-rw-r--r-- | docker/crupest-api/CrupestApi/CrupestApi.Commons/Error.cs | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Error.cs b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Error.cs deleted file mode 100644 index b298f7a..0000000 --- a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Error.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace CrupestApi.Commons; - -public class ErrorBody -{ - public ErrorBody(string message) - { - Message = message; - } - - public string Message { get; set; } -} - -public static class CrupestApiErrorExtensions -{ - public static async Task WriteErrorMessageAsync(this HttpResponse response, string message, int statusCode = 400, HttpResponseAction? beforeWriteBody = null, CancellationToken cancellationToken = default) - { - await response.WriteJsonAsync(new ErrorBody(message), statusCode: statusCode, beforeWriteBody, cancellationToken); - } -} |