Capture SQL SP error in core EF
From Logic Wiki
If you have a stored procedure, and want to return an error to the API using RAISEERROR it can be done, but the error severity must be between 11 and 18. Anything less that 11 and EF treats it as informational and so does not actually return an error.
Greater than 18 requires a special role within SQL Server.
https://stackoverflow.com/questions/10398767/database-error-handling-in-entity-framework