@@ -, +, @@ Koha::Exception::BadSystemPreference->throw(error => 'Syspref DisplayIconsXSLT is not a valid boolean'); if (blessed($_) && $_->isa('Koha::Exception::BadSystemPreference')) { print $_->as_string(); warn $_->error, "\n", $_->trace->as_string, "\n"; } else { $_->rethrow(); } --- C4/Installer/PerlDependencies.pm | 5 +++++ Koha/Exception/BadEncoding.pm | 28 ++++++++++++++++++++++++++++ Koha/Exception/BadParameter.pm | 28 ++++++++++++++++++++++++++++ Koha/Exception/BadSystemPreference.pm | 29 +++++++++++++++++++++++++++++ Koha/Exception/ConnectionFailed.pm | 28 ++++++++++++++++++++++++++++ Koha/Exception/DuplicateObject.pm | 28 ++++++++++++++++++++++++++++ Koha/Exception/File.pm | 28 ++++++++++++++++++++++++++++ Koha/Exception/LoginFailed.pm | 28 ++++++++++++++++++++++++++++ Koha/Exception/NoSystemPreference.pm | 29 +++++++++++++++++++++++++++++ Koha/Exception/RemoteInvocation.pm | 28 ++++++++++++++++++++++++++++ Koha/Exception/SystemCall.pm | 28 ++++++++++++++++++++++++++++ Koha/Exception/UnknownObject.pm | 28 ++++++++++++++++++++++++++++ Koha/Exception/UnknownProtocol.pm | 28 ++++++++++++++++++++++++++++ 13 files changed, 343 insertions(+) create mode 100644 Koha/Exception/BadEncoding.pm create mode 100644 Koha/Exception/BadParameter.pm create mode 100644 Koha/Exception/BadSystemPreference.pm create mode 100644 Koha/Exception/ConnectionFailed.pm create mode 100644 Koha/Exception/DuplicateObject.pm create mode 100644 Koha/Exception/File.pm create mode 100644 Koha/Exception/LoginFailed.pm create mode 100644 Koha/Exception/NoSystemPreference.pm create mode 100644 Koha/Exception/RemoteInvocation.pm create mode 100644 Koha/Exception/SystemCall.pm create mode 100644 Koha/Exception/UnknownObject.pm create mode 100644 Koha/Exception/UnknownProtocol.pm --- a/C4/Installer/PerlDependencies.pm +++ a/C4/Installer/PerlDependencies.pm @@ -99,6 +99,11 @@ our $PERL_DEPS = { 'required' => '1', 'min_ver' => '1.103' }, + 'Exception::Class' => { + 'usage' => 'Core', + 'required' => '1.39', + 'min_ver' => '1.39' + }, 'HTML::Scrubber' => { 'usage' => 'Core', 'required' => '1', --- a/Koha/Exception/BadEncoding.pm +++ a/Koha/Exception/BadEncoding.pm @@ -0,0 +1,28 @@ +package Koha::Exception::BadEncoding; + +# Copyright 2015 Vaara-kirjastot +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Exception::Class ( + 'Koha::Exception::BadEncoding' => { + description => 'Something wrong with the character encoding', + }, +); + +return 1; --- a/Koha/Exception/BadParameter.pm +++ a/Koha/Exception/BadParameter.pm @@ -0,0 +1,28 @@ +package Koha::Exception::BadParameter; + +# Copyright 2015 Vaara-kirjastot +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Exception::Class ( + 'Koha::Exception::BadParameter' => { + description => 'Something wrong with the given parameters', + }, +); + +return 1; --- a/Koha/Exception/BadSystemPreference.pm +++ a/Koha/Exception/BadSystemPreference.pm @@ -0,0 +1,29 @@ +package Koha::Exception::BadSystemPreference; + +# Copyright 2015 Vaara-kirjastot +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Exception::Class ( + 'Koha::Exception::BadSystemPreference' => { + description => 'System preference value is incomprehensible', + fields => ['syspref'], + }, +); + +return 1; --- a/Koha/Exception/ConnectionFailed.pm +++ a/Koha/Exception/ConnectionFailed.pm @@ -0,0 +1,28 @@ +package Koha::Exception::ConnectionFailed; + +# Copyright 2015 Vaara-kirjastot +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Exception::Class ( + 'Koha::Exception::ConnectionFailed' => { + description => 'Connecting to host failed', + }, +); + +return 1; --- a/Koha/Exception/DuplicateObject.pm +++ a/Koha/Exception/DuplicateObject.pm @@ -0,0 +1,28 @@ +package Koha::Exception::DuplicateObject; + +# Copyright 2015 Vaara-kirjastot +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Exception::Class ( + 'Koha::Exception::DuplicateObject' => { + description => 'Same object already exists', + }, +); + +return 1; --- a/Koha/Exception/File.pm +++ a/Koha/Exception/File.pm @@ -0,0 +1,28 @@ +package Koha::Exception::File; + +# Copyright 2015 Vaara-kirjastot +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Exception::Class ( + 'Koha::Exception::File' => { + description => 'Something wrong with the given file', + }, +); + +return 1; --- a/Koha/Exception/LoginFailed.pm +++ a/Koha/Exception/LoginFailed.pm @@ -0,0 +1,28 @@ +package Koha::Exception::LoginFailed; + +# Copyright 2015 Vaara-kirjastot +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Exception::Class ( + 'Koha::Exception::LoginFailed' => { + description => 'Login to host failed', + }, +); + +return 1; --- a/Koha/Exception/NoSystemPreference.pm +++ a/Koha/Exception/NoSystemPreference.pm @@ -0,0 +1,29 @@ +package Koha::Exception::NoSystemPreference; + +# Copyright 2015 Vaara-kirjastot +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Exception::Class ( + 'Koha::Exception::NoSystemPreference' => { + description => 'Required system preference is not set', + fields => ['syspref'], + }, +); + +return 1; --- a/Koha/Exception/RemoteInvocation.pm +++ a/Koha/Exception/RemoteInvocation.pm @@ -0,0 +1,28 @@ +package Koha::Exception::RemoteInvocation; + +# Copyright 2015 Vaara-kirjastot +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Exception::Class ( + 'Koha::Exception::RemoteInvocation' => { + description => 'Interacting with a remote process failed', + }, +); + +return 1; --- a/Koha/Exception/SystemCall.pm +++ a/Koha/Exception/SystemCall.pm @@ -0,0 +1,28 @@ +package Koha::Exception::SystemCall; + +# Copyright 2015 Vaara-kirjastot +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Exception::Class ( + 'Koha::Exception::SystemCall' => { + description => 'Making a system call failed', + }, +); + +return 1; --- a/Koha/Exception/UnknownObject.pm +++ a/Koha/Exception/UnknownObject.pm @@ -0,0 +1,28 @@ +package Koha::Exception::UnknownObject; + +# Copyright 2015 Vaara-kirjastot +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Exception::Class ( + 'Koha::Exception::UnknownObject' => { + description => 'Object cannot be found or is not known', + }, +); + +return 1; --- a/Koha/Exception/UnknownProtocol.pm +++ a/Koha/Exception/UnknownProtocol.pm @@ -0,0 +1,28 @@ +package Koha::Exception::UnknownProtocol; + +# Copyright 2015 Vaara-kirjastot +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Exception::Class ( + 'Koha::Exception::UnknownProtocol' => { + description => 'Protocol is not known', + }, +); + +return 1; --