View | Details | Raw Unified | Return to bug 13995
Collapse All | Expand All

(-)a/Koha/Exception.pm (+33 lines)
Line 0 Link Here
1
package Koha::Exception;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception' => {
24
        description => 'Koha exceptions base class',
25
    },
26
);
27
28
sub newFromDie {
29
    my ($class, $die) = @_;
30
    return Koha::Exception->new(error => "$die");
31
}
32
33
return 1;
(-)a/Koha/Exception/BadAuthenticationToken.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BadAuthenticationToken;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BadAuthenticationToken' => {
24
        isa => 'Koha::Exception',
25
        description => 'Authentication token is invalid',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BadEncoding.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BadEncoding;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BadEncoding' => {
24
        isa => 'Koha::Exception',
25
        description => 'Something wrong with the character encoding',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BadParameter.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BadParameter;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BadParameter' => {
24
        isa => 'Koha::Exception',
25
        description => 'Something wrong with the given parameters',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BadSystemPreference.pm (+30 lines)
Line 0 Link Here
1
package Koha::Exception::BadSystemPreference;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BadSystemPreference' => {
24
        isa => 'Koha::Exception',
25
        description => 'System preference value is incomprehensible',
26
        fields => ['syspref'],
27
    },
28
);
29
30
return 1;
(-)a/Koha/Exception/BatchOverlay.pm (+30 lines)
Line 0 Link Here
1
package Koha::Exception::BatchOverlay;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BatchOverlay' => {
24
        isa => 'Koha::Exception',
25
        description => "Extendable core class for BatchOverlay Exceptions.",
26
        fields => [ 'records', 'overlayRule', 'searchAlgorithm', 'searchTerm' ],
27
    },
28
);
29
30
return 1;
(-)a/Koha/Exception/BatchOverlay/DuplicateSearchTerm.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BatchOverlay::DuplicateSearchTerm;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BatchOverlay::DuplicateSearchTerm' => {
24
        isa => 'Koha::Exception::BatchOverlay',
25
        description => "Same search is requested twice. This can cause a myriad of problems with the search and indexing subsystem.",
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BatchOverlay/LocalSearch.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BatchOverlay::LocalSearch;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BatchOverlay::LocalSearch' => {
24
        isa => 'Koha::Exception::BatchOverlay',
25
        description => 'Something happened when looking for the right local record using a search term.',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BatchOverlay/LocalSearchAmbiguous.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BatchOverlay::LocalSearchAmbiguous;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BatchOverlay::LocalSearchAmbiguous' => {
24
        isa => 'Koha::Exception::BatchOverlay',
25
        description => "Local search term doesn't return a unique result.",
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BatchOverlay/LocalSearchNoResults.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BatchOverlay::LocalSearchNoResults;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BatchOverlay::LocalSearchNoResults' => {
24
        isa => 'Koha::Exception::BatchOverlay',
25
        description => 'No local biblio matches the given search result.',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BatchOverlay/Marc.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BatchOverlay::Marc;
2
3
# Copyright 2016 Koha-Suomi Oy
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BatchOverlay::Marc' => {
24
        isa => 'Koha::Exception::BatchOverlay',
25
        description => 'Something wrong with the MARC record',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BatchOverlay/NoBreedinRecord.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BatchOverlay::NoBreedinRecord;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BatchOverlay::NoBreedinRecord' => {
24
        isa => 'Koha::Exception::BatchOverlay',
25
        description => 'A record which should be in the breeding-tables is not there?',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BatchOverlay/RemoteSearchAmbiguous.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BatchOverlay::RemoteSearchNoResults;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BatchOverlay::RemoteSearchNoResults' => {
24
        isa => 'Koha::Exception::BatchOverlay',
25
        description => 'Searching from the remote target returned no results.',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BatchOverlay/RemoteSearchFailed.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BatchOverlay::RemoteSearchAmbiguous;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BatchOverlay::RemoteSearchAmbiguous' => {
24
        isa => 'Koha::Exception::BatchOverlay',
25
        description => 'Searching from the remote target returned more results than expected.',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BatchOverlay/RemoteSearchNoResults.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BatchOverlay::RemoteSearchFailed;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BatchOverlay::RemoteSearchFailed' => {
24
        isa => 'Koha::Exception::BatchOverlay',
25
        description => 'Searching from the remote target failed.',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BatchOverlay/UnknownMatcher.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BatchOverlay::UnknownMatcher;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BatchOverlay::UnknownMatcher' => {
24
        isa => 'Koha::Exception::BatchOverlay',
25
        description => "Configured Matcher doesn't exist.",
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BatchOverlay/UnknownRemoteTarget.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BatchOverlay::UnknownRemoteTarget;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BatchOverlay::UnknownRemoteTarget' => {
24
        isa => 'Koha::Exception::BatchOverlay',
25
        description => "Configured Remote target doesn't exist.",
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/BatchOverlay/UnknownSearchAlgorithm.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::BatchOverlay::UnknownSearchAlgorithm;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::BatchOverlay::UnknownSearchAlgorithm' => {
24
        isa => 'Koha::Exception::BatchOverlay',
25
        description => "Requested search algorithm doesn't exist.",
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/ConnectionFailed.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::ConnectionFailed;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::ConnectionFailed' => {
24
        isa => 'Koha::Exception',
25
        description => 'Connecting to host failed',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/DB.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::DB;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::DB' => {
24
        isa => 'Koha::Exception',
25
        description => 'Something wrong with the database',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/Deduplicator.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::Deduplicator;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::Deduplicator' => {
24
        isa => 'Koha::Exception',
25
        description => "Deduplicator base exception class",
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/Deduplicator/TooManyMatches.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::Deduplicator::TooManyMatches;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::Deduplicator::TooManyMatches' => {
24
        isa => 'Koha::Exception::Deduplicator',
25
        description => "Deduplicator has found too many matches for one deduplicated record",
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/DuplicateObject.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::DuplicateObject;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::DuplicateObject' => {
24
        isa => 'Koha::Exception',
25
        description => 'Same object already exists',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/Expired.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::Expired;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::Expired' => {
24
        isa => 'Koha::Exception',
25
        description => 'Object expired and is now stale',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/FeatureUnavailable.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::FeatureUnavailable;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::FeatureUnavailable' => {
24
        isa => 'Koha::Exception',
25
        description => 'Feature requested is not currently available',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/File.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::File;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::File' => {
24
        isa => 'Koha::Exception',
25
        description => 'Something wrong with the given file',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/Labels.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::Labels;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::Labels' => {
24
        isa => 'Koha::Exception',
25
        description => "Labels base exception class",
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/Labels/UnknownItems.pm (+30 lines)
Line 0 Link Here
1
package Koha::Exception::Labels::UnknownItems;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::Labels::UnknownItems' => {
24
        isa => 'Koha::Exception::Labels',
25
        description => 'a bunch of Items cannot be found from the given input',
26
        fields => [ 'badBunch' ],
27
    },
28
);
29
30
return 1;
(-)a/Koha/Exception/LoginFailed.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::LoginFailed;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::LoginFailed' => {
24
        isa => 'Koha::Exception',
25
        description => 'Login to host failed',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/Logout.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::Logout;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::Logout' => {
24
        isa => 'Koha::Exception',
25
        description => 'User logged out, catch this and redirect.',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/NoPermission.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::NoPermission;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::NoPermission' => {
24
        isa => 'Koha::Exception',
25
        description => 'User has no permission to do whatever he was up to',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/NoSystemPreference.pm (+30 lines)
Line 0 Link Here
1
package Koha::Exception::NoSystemPreference;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::NoSystemPreference' => {
24
        isa => 'Koha::Exception',
25
        description => 'Required system preference is not set',
26
        fields => ['syspref'],
27
    },
28
);
29
30
return 1;
(-)a/Koha/Exception/NotImplemented.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::NotImplemented;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::NotImplemented' => {
24
        isa => 'Koha::Exception',
25
        description => 'Subroutine requires implementation.',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/ObjectExists.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::ObjectExists;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::ObjectExists' => {
24
        isa => 'Koha::Exception',
25
        description => 'The given Object already exists',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/Parse.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::Parse;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::Parse' => {
24
        isa => 'Koha::Exception',
25
        description => 'Parsing the given input failed',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/RemoteInvocation.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::RemoteInvocation;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::RemoteInvocation' => {
24
        isa => 'Koha::Exception',
25
        description => 'Interacting with a remote process failed',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/SMSDeliveryFailure.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::SMSDeliveryFailure;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::SMSDeliveryFailure' => {
24
        isa => 'Koha::Exception',
25
        description => 'SMS delivery was failed.',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/Search.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::Search;
2
3
# Copyright 2017 Koha-Suomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::Search' => {
24
        isa => 'Koha::Exception',
25
        description => 'Performing the given search failed',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/SelfService.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::SelfService;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::SelfService' => {
24
        isa => 'Koha::Exception',
25
        description => "A generic Self-Service exception type",
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/SelfService/BlockedBorrowerCategory.pm (+17 lines)
Line 0 Link Here
1
package Koha::Exception::SelfService::BlockedBorrowerCategory;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
8
use Modern::Perl;
9
10
use Exception::Class (
11
    'Koha::Exception::SelfService::BlockedBorrowerCategory' => {
12
        isa => 'Koha::Exception::SelfService',
13
        description => "The given borrower has an unauthorized borrower category",
14
    },
15
);
16
17
return 1;
(-)a/Koha/Exception/SelfService/OpeningHours.pm (+18 lines)
Line 0 Link Here
1
package Koha::Exception::SelfService::OpeningHours;
2
3
# Copyright 2017 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
8
use Modern::Perl;
9
10
use Exception::Class (
11
    'Koha::Exception::SelfService::OpeningHours' => {
12
        isa => 'Koha::Exception::SelfService',
13
        description => "Self-service resource closed at this time. Possibly outside opening hours or otherwise library has set this resource unavailable at this specific time. Try again alter. Attached time fields in ISO8601.",
14
        fields => ['startTime', 'endTime'],
15
    },
16
);
17
18
return 1;
(-)a/Koha/Exception/SelfService/PermissionRevoked.pm (+17 lines)
Line 0 Link Here
1
package Koha::Exception::SelfService::PermissionRevoked;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
8
use Modern::Perl;
9
10
use Exception::Class (
11
    'Koha::Exception::SelfService::PermissionRevoked' => {
12
        isa => 'Koha::Exception::SelfService',
13
        description => "The given borrower has got his self-service usage permission revoked",
14
    },
15
);
16
17
return 1;
(-)a/Koha/Exception/SelfService/TACNotAccepted.pm (+17 lines)
Line 0 Link Here
1
package Koha::Exception::SelfService::TACNotAccepted;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
8
use Modern::Perl;
9
10
use Exception::Class (
11
    'Koha::Exception::SelfService::TACNotAccepted' => {
12
        isa => 'Koha::Exception::SelfService',
13
        description => "Self-Service terms and conditions has not been accepted by the user in the OPAC",
14
    },
15
);
16
17
return 1;
(-)a/Koha/Exception/SelfService/Underage.pm (+18 lines)
Line 0 Link Here
1
package Koha::Exception::SelfService::Underage;
2
3
# Copyright 2016 KohaSuomi
4
#
5
# This file is part of Koha.
6
#
7
8
use Modern::Perl;
9
10
use Exception::Class (
11
    'Koha::Exception::SelfService::Underage' => {
12
        isa => 'Koha::Exception::SelfService',
13
        description => "The given borrower is too young to access the self-service resource",
14
        fields => ['minimumAge'],
15
    },
16
);
17
18
return 1;
(-)a/Koha/Exception/ServiceTemporarilyUnavailable.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::ServiceTemporarilyUnavailable;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::ServiceTemporarilyUnavailable' => {
24
        isa => 'Koha::Exception',
25
        description => 'Service is temporarily unavailable',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/SubroutineCall.pm (+17 lines)
Line 0 Link Here
1
package Koha::Exception::SubroutineCall;
2
3
# Copyright 2016 Koha-Suomi Oy
4
#
5
# This file is part of Koha.
6
#
7
8
use Modern::Perl;
9
10
use Exception::Class (
11
    'Koha::Exception::SubroutineCall' => {
12
        isa => 'Koha::Exception',
13
        description => 'Subroutine is called wrongly',
14
    },
15
);
16
17
return 1;
(-)a/Koha/Exception/SystemCall.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::SystemCall;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::SystemCall' => {
24
        isa => 'Koha::Exception',
25
        description => 'Making a system call failed',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/UnknownObject.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::UnknownObject;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::UnknownObject' => {
24
        isa => 'Koha::Exception',
25
        description => 'Object cannot be found or is not known',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/UnknownProgramState.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::UnknownProgramState;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::UnknownProgramState' => {
24
        isa => 'Koha::Exception',
25
        description => 'The running program has done something terribly unpredicatable',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/UnknownProtocol.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::UnknownProtocol;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::UnknownProtocol' => {
24
        isa => 'Koha::Exception',
25
        description => 'Protocol is not known',
26
    },
27
);
28
29
return 1;
(-)a/Koha/Exception/VersionMismatch.pm (+29 lines)
Line 0 Link Here
1
package Koha::Exception::VersionMismatch;
2
3
# Copyright 2015 Vaara-kirjastot
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Exception::Class (
23
    'Koha::Exception::VersionMismatch' => {
24
        isa => 'Koha::Exception',
25
        description => 'Versions do not match',
26
    },
27
);
28
29
return 1;
(-)a/t/Exception.t (-1 / +25 lines)
Line 0 Link Here
0
- 
1
use Modern::Perl;
2
use Test::More;
3
use Scalar::Util qw(blessed);
4
5
use Try::Tiny;
6
use Koha::Exception::UnknownProgramState;
7
8
subtest "Throw and catch a Koha::Exception", \&tryCatch;
9
sub tryCatch {
10
  eval {
11
12
  try {
13
    Koha::Exception::UnknownProgramState->throw(error => 'Test this!');
14
    ok(0, 'Y U No error!');
15
  } catch {
16
    is(ref($_), 'Koha::Exception::UnknownProgramState', 'Is a proper Koha::Exception');
17
    ok($_->isa('Koha::Exception'), 'Is a Koha::Exception subclass');
18
    is($_->error, 'Test this!', 'Correct error message');
19
  };
20
21
  };
22
  ok(0, $@) if $@;
23
};
24
25
done_testing;

Return to bug 13995