Stored procedures report errors to client applications via the RAISERROR command.
RAISERROR doesn’t change the flow of a procedure; it merely displays an error message, sets the @ automatic variable, and optionally writes the message to the SQL Server error log and the NT application event log.