From 7be9fa68bef82a7576344a6e8cc1e51154c6b3bf Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Mon, 11 Jan 2021 22:20:09 -0300 Subject: Response & Exception refactor --- lib/Matrix/Client/Exception.rakumod | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/Matrix/Client/Exception.rakumod (limited to 'lib/Matrix/Client/Exception.rakumod') 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'" } + } +} -- cgit v1.2.3-70-g09d2