From 11887ecedb11d452255e9a67f9c799ddf09d739d Mon Sep 17 00:00:00 2001 From: data-miner00 Date: Wed, 3 Jan 2024 23:20:57 +0800 Subject: [PATCH] fix: Carriage return issue --- src/Linker.WebApi/Controllers/TagController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Linker.WebApi/Controllers/TagController.cs b/src/Linker.WebApi/Controllers/TagController.cs index bc66dfd..d15d5be 100644 --- a/src/Linker.WebApi/Controllers/TagController.cs +++ b/src/Linker.WebApi/Controllers/TagController.cs @@ -73,7 +73,7 @@ public async Task CreateAsync([FromBody] CreateTagRequest request await this.repository.AddAsync(request.TagName).ConfigureAwait(false); return this.NoContent(); } - catch (SQLiteException ex) when (ex.Message.Equals("constraint failed\r\nUNIQUE constraint failed: Tags.Name")) + catch (SQLiteException ex) when (ex.Message.Contains("UNIQUE constraint failed: Tags.Name")) { return this.BadRequest("The tag with the same name already exists."); }