From f32d732d4302b85406a22ebac2ade5dab77889fd Mon Sep 17 00:00:00 2001
From: Tomas Cohen Arazi <tomascohen@theke.io>
Date: Mon, 8 Jul 2024 14:34:25 -0300
Subject: [PATCH] [23.05.x] Bug 37018: Add Koha::Exceptions::REST
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
---
Koha/Exceptions/REST.pm | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
create mode 100644 Koha/Exceptions/REST.pm
diff --git a/Koha/Exceptions/REST.pm b/Koha/Exceptions/REST.pm
new file mode 100644
index 00000000000..bbcd0fed6bd
--- /dev/null
+++ b/Koha/Exceptions/REST.pm
@@ -0,0 +1,33 @@
+package Koha::Exceptions::REST;
+
+use Modern::Perl;
+
+use Koha::Exception;
+
+use Exception::Class (
+ 'Koha::Exceptions::REST' => {
+ isa => 'Koha::Exception',
+ },
+ 'Koha::Exceptions::REST::Query::InvalidOperator' => {
+ description => "Invalid operator found in query",
+ fields => ['operator']
+ },
+);
+
+=head1 NAME
+
+Koha::Exceptions::REST - Base class for REST API exceptions
+
+=head1 Exceptions
+
+=head2 Koha::Exceptions::REST
+
+Generic REST API exception.
+
+=head2 Koha::Exceptions::REST::Query::InvalidOperator
+
+The passed query is not allowed.
+
+=cut
+
+1;
--
2.45.2