This works fine.
declare
@error_number int,
@error_message varchar(100)
begin try
begin transaction
-- here I intentionally enter number that's larger than int:
insert into t values (67896789867);
insert into t values (5);
commit transaction
end try
begin catch
select @error_number = error_number(),
@error_message...