19.11.2014 Views

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 27<br />

Exceptions<br />

27.1 <strong>The</strong> Trait <strong>Fortress</strong>.Standard.Exception<br />

<strong>The</strong> trait Exception is a single root of the exception hierarchy; every exception in <strong>Fortress</strong> has trait Exception. An<br />

exception is either a CheckedException or an UncheckException. Every exception has optional fields: a message<br />

and a chained exception. <strong>The</strong>se fields are default to Nothing where an optional value v is either Nothing or Just(v)<br />

as declared in Section 31.2.<br />

trait Exception comprises { CheckedException, UncheckedException }<br />

settable message: MaybeString<br />

settable chain:MaybeException<br />

end<br />

27.1.1 settable message: MaybeString<br />

When an exception is thrown, its message may be set.<br />

27.1.2 settable chain: MaybeException<br />

When an exception is thrown, its chain may be set to the exception thrown immediately before this exception.<br />

27.2 <strong>The</strong> Trait <strong>Fortress</strong>.Standard.CheckedException<br />

trait CheckedException<br />

extends { Exception }<br />

excludes { UncheckedException }<br />

end<br />

204

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!