usp_RethrowError Stored Procedure

<< Click to Display Table of Contents >>

Navigation:  iVend Database Database > Stored Procedures >

usp_RethrowError Stored Procedure

Navigation: iVend Database Database > Stored Procedures >

hm_btn_navigate_prevhm_btn_navigate_tophm_btn_navigate_next

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

dbimages_boolean-false

Ansi Nulls

dbimages_boolean-true

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

AssignTill procedure

AssignTill

Stored Procedure

Assigns a Till to the selected POS

1

GetMobileReplicationData procedure

GetMobileReplicationData

Stored Procedure

 

1

InvGetSelectedAttributeProduct procedure

InvGetSelectedAttributeProduct

Stored Procedure

 

1

RecalculateSlabForLoyaltyCustomer procedure

RecalculateSlabForLoyaltyCustomer

Stored Procedure

 

1

RemoveTill procedure

RemoveTill

Stored Procedure

Removes a Till from the selected POS

1

TrxCompleteTransactionUpdates procedure

TrxCompleteTransactionUpdates

Stored Procedure

 

2

UpdateTillAfterPaymentInsert procedure

UpdateTillAfterPaymentInsert

Stored Procedure

Handles updates to Till once payment against a particular payment type has been taken

1

UpdateTillAmounts procedure

UpdateTillAmounts

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

Related Objects

iVend Database Database

 

 


© 2019 All Rights Reserved.

Send comments on this topic.