You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2014/02/06 11:39:12 UTC

svn commit: r1565152 - in /isis/site/trunk/content: ./ applib-guide/how-tos/

Author: danhaywood
Date: Thu Feb  6 10:39:12 2014
New Revision: 1565152

URL: http://svn.apache.org/r1565152
Log:
stuff on services

Removed:
    isis/site/trunk/content/applib-guide/how-tos/how-to-06-020-How-to-deal-with-an-unexpected-error.md
Modified:
    isis/site/trunk/content/applib-guide/how-tos/about.md
    isis/site/trunk/content/applib-guide/how-tos/how-to-06-010-How-to-pass-a-messages-and-errors-back-to-the-user.md
    isis/site/trunk/content/documentation.md

Modified: isis/site/trunk/content/applib-guide/how-tos/about.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/applib-guide/how-tos/about.md?rev=1565152&r1=1565151&r2=1565152&view=diff
==============================================================================
--- isis/site/trunk/content/applib-guide/how-tos/about.md (original)
+++ isis/site/trunk/content/applib-guide/how-tos/about.md Thu Feb  6 10:39:12 2014
@@ -176,9 +176,7 @@ been placed vs one that has been shipped
 Things go wrong. *Isis* handles many of the usual error conditions, but
 your app may also wish to notify the user also when something goes awry.
 
-* [How to pass a messages and errors back to the user](./how-to-06-010-How-to-pass-a-messages-and-errors-back-to-the-user.html)
-
-* [How to deal with an unexpected error](./how-to-06-020-How-to-deal-with-an-unexpected-error.html)
+* [How to pass a messages and raise errors to the user](./how-to-06-010-How-to-pass-a-messages-and-errors-back-to-the-user.html)
 
 
 ##How to handle the entity persistence lifecycle

Modified: isis/site/trunk/content/applib-guide/how-tos/how-to-06-010-How-to-pass-a-messages-and-errors-back-to-the-user.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/applib-guide/how-tos/how-to-06-010-How-to-pass-a-messages-and-errors-back-to-the-user.md?rev=1565152&r1=1565151&r2=1565152&view=diff
==============================================================================
--- isis/site/trunk/content/applib-guide/how-tos/how-to-06-010-How-to-pass-a-messages-and-errors-back-to-the-user.md (original)
+++ isis/site/trunk/content/applib-guide/how-tos/how-to-06-010-How-to-pass-a-messages-and-errors-back-to-the-user.md Thu Feb  6 10:39:12 2014
@@ -21,14 +21,37 @@ successful ('No Customer found with name
 
 -   `raiseError(String message)`
 
-    Indicate that a serious application error has occurred. The viewer
+    Indicate that an application exception has occurred. The viewer
     should again require the user to acknowledge the message, and quite
     possibly indicate further steps that the user should perform (eg
     notify the help desk).
 
-    In this last case, no changes will be made to any objects (the
-    transaction is aborted).
 
 The precise mechanics of how each of these messages is rendered visible
 to the user is determined by the viewer being used.
 
+
+Alternative way to raise an error
+---------------------------------
+
+An alternative to calling `DomainObjectContainer#raiseError()` <!--(see ?)-->
+is to simply throw an `org.apache.isis.applib.ApplicationException`. Which
+you use is a matter of style, because the behaviour is exactly the same; internally `raiseError()` just throws the `ApplicationException`.
+
+As of [1.4.0-SNAPSHOT], can also throw `org.apache.isis.applib.RecoverableException`.
+
+
+How to deal with an unrecoverable and unexpected error
+------------------------------------------------------
+
+Throw any exception that isn't a subclass of `ApplicationException` (or `RecoverableException` as of 1.4.0-SNAPSHOT).
+
+The `org.apache.isis.applib.UnrecoverableException` is provided as a convenient superclass to use, but this is not required.
+
+
+Handling aborted transactions [1.4.0-SNAPSHOT]
+-----------------------------
+
+If underlying transaction is aborted by the framework - for example as the result of a constraint violation in the objectstore - then the application code should *not* throw `ApplicationException` (or `RecoverableException`), it should throw some other (non-recoverable) exception.
+
+However, the wrong type of exception being thrown will be automatically detected, and a non-recoverable exception will be thrown instead.
\ No newline at end of file

Modified: isis/site/trunk/content/documentation.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/documentation.md?rev=1565152&r1=1565151&r2=1565152&view=diff
==============================================================================
--- isis/site/trunk/content/documentation.md (original)
+++ isis/site/trunk/content/documentation.md Thu Feb  6 10:39:12 2014
@@ -203,8 +203,8 @@ For both:
 
 #### Error handling
 
-* [Raise message to users](./applib-guide/how-tos/how-to-06-010-How-to-pass-a-messages-and-errors-back-to-the-user.html)
-* [Unexpected errors](./applib-guide/how-tos/how-to-06-020-How-to-deal-with-an-unexpected-error.html)
+* [Raise message/errors to users](./applib-guide/how-tos/how-to-06-010-How-to-pass-a-messages-and-errors-back-to-the-user.html)
+* [Exception Recognizer](core/services/exception-recognizers.html) service
 
 #### Prototyping tips