aboutsummaryrefslogtreecommitdiff
path: root/lib/Matrix/Client/Exception.rakumod
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@gmail.com>2021-01-11 22:20:09 -0300
committerMatias Linares <matiaslina@gmail.com>2021-01-11 22:20:09 -0300
commit7be9fa68bef82a7576344a6e8cc1e51154c6b3bf (patch)
treed60908a75c60b55d4ea90f6079c2459f9cf56be9 /lib/Matrix/Client/Exception.rakumod
parent9da9134f0b28c0e4c69537b54fd96dca3a66aaed (diff)
downloadperl6-matrix-client-7be9fa68bef82a7576344a6e8cc1e51154c6b3bf.tar.gz
Response & Exception refactor
Diffstat (limited to 'lib/Matrix/Client/Exception.rakumod')
-rw-r--r--lib/Matrix/Client/Exception.rakumod17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Matrix/Client/Exception.rakumod b/lib/Matrix/Client/Exception.rakumod
new file mode 100644
index 0000000..6fb4c75
--- /dev/null
+++ b/lib/Matrix/Client/Exception.rakumod
@@ -0,0 +1,17 @@
+module Matrix::Client::Exception {
+
+ class X::Matrix::Response is Exception {
+ has $.code;
+ has $.error;
+
+ method message(--> Str) {
+ "$!code: $!error"
+ }
+ }
+
+ class X::Matrix::MXCParse is Exception {
+ has $.uri;
+
+ method message { "Cannot parse '$!uri'" }
+ }
+}