
#########################
**Cassandane::JMAPAbort**
#########################


****
NAME
****


Cassandane::JMAPAbort - a JMAP::Tester abort that counts as a failing test


***********
DESCRIPTION
***********


When JMAP::Tester gives up, it throws a `JMAP::Tester::Abort <https://metacpan.org/pod/JMAP::Tester::Abort>`_, which is a
Throwable::Error.  The test framework needs failures to be a
:doc:`Cassandane::Failure </developer/cassandane-api/Cassandane/Failure>`.  (Otherwise they get treated as \ *errors*\ , which they
aren't.)

This stupid class saves us from multiple inheritance, and
``Cassandane::Role::JMAPTester`` makes our JMAP::Tester classes use it.


*******
METHODS
*******


new
===



.. code-block:: perl

     Cassandane::JMAPAbort->new($message);
     Cassandane::JMAPAbort->new({ message => $message, diagnostics => \@diags });


Those are the two ways JMAP::Tester builds an abort.  The diagnostics have
already been formatted by the tester's diagnostic dumper, and get folded into
the message, because the message is what a report shows.

Called any other way, we assume we've been given the usual Error.pm arguments,
so that an abort can be rethrown like any other exception.


