Skip to content

Commit

Permalink
Fix some exception handling code in libmythupnp.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-kristjansson committed Jan 30, 2012
1 parent 7d1f901 commit 149b274
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mythtv/libs/libmythupnp/servicehost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ QVariant MethodInfo::Invoke( Service *pService, const QStringMap &reqParams )
QMetaType::destroy( types[ nIdx ], param[ nIdx ] );
}
}
catch(QString sMsg)
catch (QString &sMsg)
{
LOG(VB_GENERAL, LOG_ERR,
QString("MethodInfo::Invoke - An Exception Occurred: %1")
Expand All @@ -146,14 +146,14 @@ QVariant MethodInfo::Invoke( Service *pService, const QStringMap &reqParams )
if ((types[ 0 ] != 0) && (param[ 0 ] != NULL ))
QMetaType::destroy( types[ 0 ], param[ 0 ] );

throw sMsg;
throw;
}
catch(HttpRedirectException ex)
catch (HttpRedirectException &ex)
{
bExceptionThrown = true;
exception = ex;
}
catch(...)
catch (...)
{
LOG(VB_GENERAL, LOG_INFO,
"MethodInfo::Invoke - An Exception Occurred" );
Expand Down Expand Up @@ -376,27 +376,27 @@ bool ServiceHost::ProcessRequest( HTTPRequest *pRequest )
UPnp::FormatErrorResponse( pRequest, UPnPResult_InvalidAction );
}
}
catch( HttpRedirectException ex )
catch (HttpRedirectException &ex)
{
UPnp::FormatRedirectResponse( pRequest, ex.hostName );
bHandled = true;
}
catch( HttpException ex )
catch (HttpException &ex)
{
LOG(VB_GENERAL, LOG_ERR, ex.msg);
UPnp::FormatErrorResponse( pRequest, UPnPResult_ActionFailed, ex.msg );

bHandled = true;

}
catch( QString sMsg )
catch (QString &sMsg)
{
LOG(VB_GENERAL, LOG_ERR, sMsg);
UPnp::FormatErrorResponse( pRequest, UPnPResult_ActionFailed, sMsg );

bHandled = true;
}
catch( ... )
catch ( ...)
{
QString sMsg( "ServiceHost::ProcessRequest - Unexpected Exception" );

Expand Down

0 comments on commit 149b274

Please sign in to comment.