-- Copyright (c) 2015 gutlib.com - All rights reserved. Terms are in gutlib.sql
-- You are NOT ALLOWED to modify and/or use this code without author permission
if object_id('g.err') is null
   exec('create procedure g.err as
      RAISERROR (''g.err.err.1: not implemented'' ,16 ,1) WITH NOWAIT')
go
alter procedure g.err
    @arg1 nvarchar(max) = null
   ,@arg2 nvarchar(max) = null
   ,@arg3 nvarchar(max) = null
   ,@arg4 nvarchar(max) = null
   ,@arg5 nvarchar(max) = null
as
declare @arg nvarchar(max) = ''
set @arg += isnull(      @arg1,'')
set @arg += isnull(' ' + @arg2,'')
set @arg += isnull(' ' + @arg3,'')
set @arg += isnull(' ' + @arg4,'')
set @arg += isnull(' ' + @arg5,'')

exec g.log @arg1,@arg2,@arg3,@arg4,@arg5,@err=16

go
begin try
   exec g.err 'g.err.test line 1'
   exec g.err 'g.err.test','line',2
end try begin catch
end catch
