From 3dc7d5cba044e16776291f520fd68ac190bcbfb6 Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Tue, 13 Feb 2018 20:53:30 -0300 Subject: Add simple error handling --- lib/Matrix/Client/Exception.pm6 | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lib/Matrix/Client/Exception.pm6 (limited to 'lib/Matrix/Client/Exception.pm6') 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" + } + } +} -- cgit v1.2.3-70-g09d2