Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [#223] HTTP error status code trying to insert duplicate categor…
…y in MySQL Using MySQL the endpoint to inser categories returns a different HTTP status code. It should return a 400 and It was returning a 500. The reason is we parse the error message and for MySQL the error message is not the same as SQLite: MySQL: ``` Error: Duplicate entry 'category name 118802' for key 'torrust_categories.name' ``` It has been changed but we should now rely on concrete error messages. Besides we should not relay on the database contrains, mahybe we should check in the handler that the category does not exist.
- Loading branch information