Skip to content

Commit

Permalink
[server] Fix incorrect response code used for exception
Browse files Browse the repository at this point in the history
(cherry picked from commit 3cc2060)
  • Loading branch information
nyalldawson committed Jun 7, 2021
1 parent d24a51c commit 8a24e36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/qgsserverapiutils.cpp
Expand Up @@ -115,13 +115,13 @@ template<typename T, class T2> T QgsServerApiUtils::parseTemporalInterval( const
const QStringList parts { interval.split( '/' ) };
if ( parts.length() != 2 )
{
throw QgsServerApiBadRequestException( QStringLiteral( "%1 is not a valid datetime interval." ).arg( interval ), QStringLiteral( "Server" ), Qgis::Critical );
throw QgsServerApiBadRequestException( QStringLiteral( "%1 is not a valid datetime interval." ).arg( interval ), QStringLiteral( "Server" ) );
}
T result { parseDate( parts[0] ), parseDate( parts[1] ) };
// Check validity
if ( result.isEmpty() )
{
throw QgsServerApiBadRequestException( QStringLiteral( "%1 is not a valid datetime interval (empty)." ).arg( interval ), QStringLiteral( "Server" ), Qgis::Critical );
throw QgsServerApiBadRequestException( QStringLiteral( "%1 is not a valid datetime interval (empty)." ).arg( interval ), QStringLiteral( "Server" ) );
}
return result;
}
Expand Down

0 comments on commit 8a24e36

Please sign in to comment.