2023-05-03 11:06:20 +02:00
|
|
|
== Why is this an issue?
|
|
|
|
|
2023-03-21 15:08:24 +01:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
=== Noncompliant code example
|
2023-03-21 15:08:24 +01:00
|
|
|
|
|
|
|
[source,javascript]
|
|
|
|
----
|
|
|
|
function f() {
|
|
|
|
try {
|
|
|
|
doSomething();
|
|
|
|
} catch (err) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
----
|
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
=== Compliant solution
|
2023-03-21 15:08:24 +01:00
|
|
|
|
|
|
|
[source,javascript]
|
|
|
|
----
|
|
|
|
function f() {
|
|
|
|
try {
|
|
|
|
doSomething();
|
|
|
|
} catch (err) {
|
|
|
|
console.log(`Exception while doing something: ${err}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
----
|
|
|
|
|
|
|
|
include::../see.adoc[]
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
2023-05-25 14:18:12 +02:00
|
|
|
=== Message
|
|
|
|
|
|
|
|
Handle this exception or don't catch it at all.
|
|
|
|
|
2023-03-21 15:08:24 +01:00
|
|
|
|
|
|
|
'''
|
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
2023-06-22 10:38:01 +02:00
|
|
|
|
2023-03-21 15:08:24 +01:00
|
|
|
endif::env-github,rspecator-view[]
|