Permalink
Browse files

Fixed formatting

  • Loading branch information...
bbkr committed Feb 9, 2012
1 parent 934fc6a commit fcbddbc55c957d81a63abb5aab5ae7fbaa450ab3
Showing with 2 additions and 2 deletions.
  1. +2 −2 README.md
View
@@ -153,6 +153,7 @@ Every exception has numeric ```code``` attribute that indicates the error type t
**Server** does all the exception handling automatically. For example if you provide application handler without some method client will receive 'Method not found' error on call to this method. However if you want to report error from method it can be done in two ways.
* End method using die.
+
```
method divide ( Int $x, Int $y ) {
die 'Cannot divide by 0' if $y ~~ 0;
@@ -162,17 +163,16 @@ Every exception has numeric ```code``` attribute that indicates the error type t
Client will receive 'Internal error' with message 'Cannot divide by 0' as ```data``` attribute.
* Throw ```JSON::RPC::Error``` exception.
+
```
class My::App {
-
method treasure {
JSON::RPC::Error.new(
code => -1,
message => 'Access denied',
data => 'Thou shall not pass'
).throw;
}
-
}
```

0 comments on commit fcbddbc

Please sign in to comment.