Skip to content
Permalink
Browse files
[server] Fix incorrect response code used for exception
  • Loading branch information
nyalldawson committed Jun 1, 2021
1 parent 3491f40 commit 3cc20607bcfbd2b058618b8b49d8f61ccef597b1
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/server/qgsserverapiutils.cpp
@@ -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;
}

0 comments on commit 3cc2060

Please sign in to comment.