summaryrefslogtreecommitdiff
path: root/lib/Matrix/Client/Exception.pm6
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@openmailbox.org>2018-02-13 20:53:30 -0300
committerMatias Linares <matiaslina@openmailbox.org>2018-02-13 20:53:30 -0300
commit3dc7d5cba044e16776291f520fd68ac190bcbfb6 (patch)
treee11113ddceda95ec0d19a0836e2bd1085d6a2995 /lib/Matrix/Client/Exception.pm6
parent48275aea7d425f83650650807704770dcf1634bb (diff)
downloadperl6-matrix-client-3dc7d5cba044e16776291f520fd68ac190bcbfb6.tar.gz
Add simple error handling
Diffstat (limited to 'lib/Matrix/Client/Exception.pm6')
-rw-r--r--lib/Matrix/Client/Exception.pm610
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Matrix/Client/Exception.pm6 b/lib/Matrix/Client/Exception.pm6
new file mode 100644
index 0000000..924eece
--- /dev/null
+++ b/lib/Matrix/Client/Exception.pm6
@@ -0,0 +1,10 @@
+package X::Matrix {
+ class Response is Exception {
+ has $.code;
+ has $.error;
+
+ method message {
+ "$!code: $!error"
+ }
+ }
+}