BEGIN TRY
-- Code that may cause an error
END TRY
BEGIN CATCH
-- Handle the error here
END CATCH
BEGIN TRY
-- Code that may raise a user-defined exception
IF (SomeCondition)
RAISEERROR('Custom Error Message', 16, 1)
END TRY
BEGIN CATCH
-- Handle the user-defined exception here
END CATCH