Skip to content

Commit

Permalink
Fix violations of G-1050
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippSalvisberg committed Aug 25, 2023
1 parent 87d1aa7 commit ea1e447
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/4-language-usage/5-exception-handling/g-5080.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ create or replace package body order_api as
) is
co_customer_id constant customer.id%type := in_customer_id;
co_discount constant customer.discount_percentage%type := in_discount;
co_error_label constant type_up.text := 'Error: ';
begin
customer_api.apply_discount(
in_customer_id => co_customer_id
Expand All @@ -29,7 +30,7 @@ create or replace package body order_api as
when zero_divide then
null; -- ignore
when others then
logging_package.log_error('Error: ' || sqlerrm);
logging_package.log_error(co_error_label || sqlerrm);
raise;
end discount_and_recalculate;
end order_api;
Expand All @@ -44,8 +45,10 @@ create or replace package body order_api as
in_customer_id in integer
,in_discount in number
) is
co_customer_id constant customer.id%type := in_customer_id;
co_discount constant customer.discount_percentage%type := in_discount;
co_customer_id constant customer.id%type := in_customer_id;
co_discount constant customer.discount_percentage%type := in_discount;
co_error_label constant type_up.text := 'Error: ';
co_backtrace_label constant type_up.text := ' - Backtrace: ';
begin
customer_api.apply_discount(
in_customer_id => co_customer_id
Expand All @@ -57,9 +60,9 @@ create or replace package body order_api as
null; -- ignore
when others then
logging_package.log_error(
'Error: '
co_error_label
|| sqlerrm
|| ' - Backtrace: '
|| co_backtrace_label
|| sys.dbms_utility.format_error_backtrace
);
raise;
Expand Down

0 comments on commit ea1e447

Please sign in to comment.