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

0 comments on commit 8a24e36

Please sign in to comment.