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."); }