xref: /webtrees/app/Http/Exceptions/HttpBadRequestException.php (revision fbdfd3a9d74c96803c751e4bdb8c976fb1faf0ce)
181b729d3SGreg Roach<?php
281b729d3SGreg Roach
381b729d3SGreg Roach/**
481b729d3SGreg Roach * webtrees: online genealogy
55bfc6897SGreg Roach * Copyright (C) 2022 webtrees development team
681b729d3SGreg Roach * This program is free software: you can redistribute it and/or modify
781b729d3SGreg Roach * it under the terms of the GNU General Public License as published by
881b729d3SGreg Roach * the Free Software Foundation, either version 3 of the License, or
981b729d3SGreg Roach * (at your option) any later version.
1081b729d3SGreg Roach * This program is distributed in the hope that it will be useful,
1181b729d3SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
1281b729d3SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1381b729d3SGreg Roach * GNU General Public License for more details.
1481b729d3SGreg Roach * You should have received a copy of the GNU General Public License
1581b729d3SGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
1681b729d3SGreg Roach */
1781b729d3SGreg Roach
1881b729d3SGreg Roachdeclare(strict_types=1);
1981b729d3SGreg Roach
2081b729d3SGreg Roachnamespace Fisharebest\Webtrees\Http\Exceptions;
2181b729d3SGreg Roach
22*fbdfd3a9SGreg Roachuse Fig\Http\Message\StatusCodeInterface;
2381b729d3SGreg Roachuse Fisharebest\Webtrees\I18N;
2481b729d3SGreg Roach
2581b729d3SGreg Roach/**
2681b729d3SGreg Roach * Application level exceptions.
2781b729d3SGreg Roach */
2881b729d3SGreg Roachclass HttpBadRequestException extends HttpException
2981b729d3SGreg Roach{
3081b729d3SGreg Roach    /**
3181b729d3SGreg Roach     * @param string|null $message
3281b729d3SGreg Roach     */
33c7ae241dSGreg Roach    public function __construct(string $message = null)
3481b729d3SGreg Roach    {
3581b729d3SGreg Roach        $message ??= I18N::translate('The server could not understand this request.');
3681b729d3SGreg Roach
37*fbdfd3a9SGreg Roach        parent::__construct($message, StatusCodeInterface::STATUS_BAD_REQUEST);
3881b729d3SGreg Roach    }
3981b729d3SGreg Roach}
40