Refactor error handling in Bumper, Media, Group, and Junction components to include contextual information
ci / build-backend (push) Successful in 1m35s
ci / build-frontend (push) Successful in 51s
ci / tests (push) Successful in 1m46s
ci / sonar (push) Successful in 4m43s

Updated error definitions in BumperErrors, MediaErrors, GroupErrors, and TemplateErrors to accept a parameter for contextual information, enhancing the clarity of error messages. Refactored related command handlers to utilize these updated error messages, ensuring that users receive specific details about the usage context when attempting to delete resources. Adjusted unit tests to verify the correctness of the new error handling logic.
This commit is contained in:
Leonid Pershin
2026-07-28 13:19:30 +03:00
parent f895e1ddbc
commit f924891f3b
12 changed files with 227 additions and 27 deletions
@@ -259,7 +259,7 @@ public class BumperTemplateHandlersTests
new DeleteBumperTemplateCommand(template.Id),
CancellationToken.None
);
Assert.Equal(BumperErrors.TemplateInUse, used.Error);
Assert.Equal(BumperErrors.TemplateInUse(string.Empty).Code, used.Error.Code);
}
await using (var db = fixture.New())