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