xref: /webtrees/app/Exceptions/GedcomErrorException.php (revision e93a8df2f8d797005750082cc3766c0e80799688)
1b37c98e1SGreg Roach<?php
23976b470SGreg Roach
3b37c98e1SGreg Roach/**
4b37c98e1SGreg Roach * webtrees: online genealogy
5*d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
6b37c98e1SGreg Roach * This program is free software: you can redistribute it and/or modify
7b37c98e1SGreg Roach * it under the terms of the GNU General Public License as published by
8b37c98e1SGreg Roach * the Free Software Foundation, either version 3 of the License, or
9b37c98e1SGreg Roach * (at your option) any later version.
10b37c98e1SGreg Roach * This program is distributed in the hope that it will be useful,
11b37c98e1SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12b37c98e1SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13b37c98e1SGreg Roach * GNU General Public License for more details.
14b37c98e1SGreg Roach * You should have received a copy of the GNU General Public License
1589f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
16b37c98e1SGreg Roach */
17fcfa147eSGreg Roach
18b37c98e1SGreg Roachdeclare(strict_types=1);
19b37c98e1SGreg Roach
20b37c98e1SGreg Roachnamespace Fisharebest\Webtrees\Exceptions;
21b37c98e1SGreg Roach
22b37c98e1SGreg Roachuse Exception;
23b37c98e1SGreg Roachuse Fisharebest\Webtrees\I18N;
24b37c98e1SGreg Roach
2581b729d3SGreg Roachuse function e;
2681b729d3SGreg Roach
27b37c98e1SGreg Roach/**
28b37c98e1SGreg Roach * Exception thrown when importing invalid GEDCOM data.
29b37c98e1SGreg Roach */
30b37c98e1SGreg Roachclass GedcomErrorException extends Exception
31b37c98e1SGreg Roach{
32b37c98e1SGreg Roach    /**
33b37c98e1SGreg Roach     * @param string $gedcom
34b37c98e1SGreg Roach     */
35b37c98e1SGreg Roach    public function __construct(string $gedcom)
36b37c98e1SGreg Roach    {
37b37c98e1SGreg Roach        $message = I18N::translate('Invalid GEDCOM record') . '<pre>' . e($gedcom) . '</pre>';
38b37c98e1SGreg Roach
39b37c98e1SGreg Roach        parent::__construct($message);
40b37c98e1SGreg Roach    }
41b37c98e1SGreg Roach}
42