Skip to content

Commit

Permalink
[server] Fix incorrect response code used for exception
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 1, 2021
1 parent 3491f40 commit 3cc2060
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/qgsserverapiutils.cpp
Expand Up @@ -120,13 +120,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::MessageLevel::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::MessageLevel::Critical );
throw QgsServerApiBadRequestException( QStringLiteral( "%1 is not a valid datetime interval (empty)." ).arg( interval ), QStringLiteral( "Server" ) );
}
return result;
}
Expand Down

0 comments on commit 3cc2060

Please sign in to comment.