<< Click to Display Table of Contents >> Navigation: iVend Database Database > Stored Procedures > usp_RethrowError Stored Procedure |
Navigation: iVend Database Database > Stored Procedures >
iVend 6.6 Database Help
usp_RethrowError Stored Procedure
Collapse All Expand All
iVend Database Database : usp_RethrowError Stored Procedure |
Description
Rethrow an error to the calling function/application
Properties
Creation Date |
4/13/2015 12:00 PM |
Encrypted |
|
Ansi Nulls |
Parameters
Parameter |
Direction |
Description |
Data Type |
Size |
@RETURN_VALUE |
Return Value |
|
Integer |
4 |
Objects that depend on usp_RethrowError
|
Database Object |
Object Type |
Description |
Dep Level |
Stored Procedure |
Assigns a Till to the selected POS |
1 |
||
Stored Procedure |
|
1 |
||
Stored Procedure |
|
1 |
||
Stored Procedure |
|
1 |
||
Stored Procedure |
Removes a Till from the selected POS |
1 |
||
Stored Procedure |
|
2 |
||
Stored Procedure |
Handles updates to Till once payment against a particular payment type has been taken |
1 |
||
Stored Procedure |
Handles updates to Till once payment against a transaction has been taken |
1 |
Procedure Source Code
-- Create the stored procedure to generate an error using -- RAISERROR. The original error information is used to -- construct the msg_str for RAISERROR. CREATE PROCEDURE [dbo].[usp_RethrowError] AS -- Return if there is no error information to retrieve. IF ERROR_NUMBER() IS NULL RETURN; DECLARE @ErrorMessage NVARCHAR(4000), @ErrorNumber INT, @ErrorSeverity INT, @ErrorState INT, @ErrorLine INT, @ErrorProcedure NVARCHAR(200); -- Assign variables to error-handling functions that -- capture information for RAISERROR. SELECT @ErrorNumber = ERROR_NUMBER(), @ErrorSeverity = ERROR_SEVERITY(), @ErrorState = ERROR_STATE(), @ErrorLine = ERROR_LINE(), @ErrorProcedure = ISNULL(ERROR_PROCEDURE(), '-'); -- Build the message string that will contain original -- error information. -- SELECT @ErrorMessage = -- N'Error %d, Level %d, State %d, Procedure %s, Line %d, ' + -- 'Message: '+ ERROR_MESSAGE(); SELECT @ErrorMessage = ERROR_MESSAGE(); -- Raise an error: msg_str parameter of RAISERROR will contain -- the original error information. RAISERROR ( @ErrorMessage, @ErrorSeverity, 1, @ErrorNumber, -- parameter: original error number. @ErrorSeverity, -- parameter: original error severity. @ErrorState, -- parameter: original error state. @ErrorProcedure, -- parameter: original error procedure name. @ErrorLine -- parameter: original error line number. ); |
See Also
© 2019 All Rights Reserved.
Send comments on this topic.