rspec/rules/S2737/swift/rule.adoc

46 lines
616 B
Plaintext
Raw Normal View History

2020-06-30 12:48:07 +02:00
include::../description.adoc[]
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,swift]
2020-06-30 12:48:07 +02:00
----
do {
try loadImage(imagePath)
} catch { // Noncompliant
throw error
}
----
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,swift]
2020-06-30 12:48:07 +02:00
----
do {
try loadImage(imagePath)
} catch {
handleImageError(error)
throw error
}
----
or
2022-02-04 17:28:24 +01:00
[source,swift]
2020-06-30 12:48:07 +02:00
----
try loadImage(imagePath)
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]