diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm index 7969d9f0f..b4864300b 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm @@ -128,13 +128,6 @@ sub sendError { $err ||= $req->error; $code ||= 500; $self->lmLog( "Error $code: $err", $code > 499 ? 'error' : 'notice' ); - my $title = ( - $code >= 500 ? 'Server error' - : $code == 403 ? 'Forbidden' - : $code == 401 ? 'Authentication required' - : $code == 400 ? 'Bad request' - : 'Error' - ); # SOAP responses if ( $req->env->{HTTP_SOAPACTION} ) { @@ -166,6 +159,13 @@ sub sendError { # Default response: HTML else { + my $title = ( + $code >= 500 ? 'Server error' + : $code == 403 ? 'Forbidden' + : $code == 401 ? 'Authentication required' + : $code == 400 ? 'Bad request' + : 'Error' + ); my $s = "$title