The use of Swift 2.0's ``++try!++`` lets you execute code that might throw an exception without using the ``++do++`` and ``++catch++`` syntax normally required for such code. By using it, you're guaranteeing that the executed code will never fail. Murphy's Law guarantees you're wrong. And when it does fail, the program will exit abruptly, probably without cleaning up after itself.


== Noncompliant Code Example

[source,swift]
----
let myvar = try! dangerousCode(foo);  // Noncompliant
// ...
----


== Compliant Solution

[source,swift]
----
guard let myvar = try? dangerousCode(foo) else {
  // handle error
}

// or

if let myvar = try? dangerousCode(foo); {
  // ...
} else {
  // handle error
}

// or

do {
  let myvar = try dangerousCode(foo)
  // ...
} catch {
  // handle error
}
----

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::message.adoc[]

include::highlighting.adoc[]

endif::env-github,rspecator-view[]
