Skip to content

G-5040: "When others" should be allowed for Logger with RAISE #77

Closed
@S-Koell

Description

@S-Koell

The OraLogger best practice (Link) looks like this:

exception
    when others then
      logger.log_error('Unhandled Exception', l_scope, null, l_params);
      raise;
  end todo_proc_name;

This will always give me

G-5040: Avoid use of WHEN OTHERS clause in an exception section without any other specific handlers.

I also dont want to disable this rule, because in general it's good. But with logging the error and reraising it I dont see any problem with it.
Could there be an exception for this check when doing a raise (and logging maybe) inside the "WHEN OTHERS"?
(it really bothers me because we use this practice for all fkt/procs and therefore get a ton of these PLSQL Cop warnings)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions