Guard the new sentry calls because it won't be initialized if opted out
This commit is contained in:
parent
5b5176f104
commit
53ad203028
|
@ -234,11 +234,12 @@ KIFACE* KIWAY::KiFACE( FACE_T aFaceId, bool doLoad )
|
|||
}
|
||||
}
|
||||
|
||||
wxString msg;
|
||||
|
||||
#ifdef KICAD_WIN32_VERIFY_CODESIGN
|
||||
bool codeSignOk = KIPLATFORM::ENV::VerifyFileSignature( dname );
|
||||
if( !codeSignOk )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "Failed to verify kiface library '%s' signature." ), dname );
|
||||
THROW_IO_ERROR( msg );
|
||||
}
|
||||
|
@ -261,11 +262,14 @@ KIFACE* KIWAY::KiFACE( FACE_T aFaceId, bool doLoad )
|
|||
setlocale( lc_new_type, user_locale.c_str() );
|
||||
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
wxString msg = wxString::Format( "Loading kiface %d", aFaceId );
|
||||
sentry_value_t crumb = sentry_value_new_breadcrumb( "navigation", msg.utf8_str() );
|
||||
sentry_value_set_by_key( crumb, "category", sentry_value_new_string( "kiway.kiface" ) );
|
||||
sentry_value_set_by_key( crumb, "level", sentry_value_new_string( "info" ) );
|
||||
sentry_add_breadcrumb( crumb );
|
||||
if( Pgm().IsSentryOptedIn() )
|
||||
{
|
||||
msg = wxString::Format( "Loading kiface %d", aFaceId );
|
||||
sentry_value_t crumb = sentry_value_new_breadcrumb( "navigation", msg.utf8_str() );
|
||||
sentry_value_set_by_key( crumb, "category", sentry_value_new_string( "kiway.kiface" ) );
|
||||
sentry_value_set_by_key( crumb, "level", sentry_value_new_string( "info" ) );
|
||||
sentry_add_breadcrumb( crumb );
|
||||
}
|
||||
#endif
|
||||
|
||||
if( !success )
|
||||
|
@ -449,11 +453,15 @@ KIWAY_PLAYER* KIWAY::Player( FRAME_T aFrameType, bool doCreate, wxTopLevelWindow
|
|||
try
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
wxString msg = wxString::Format( "Creating window type %d", aFrameType );
|
||||
sentry_value_t crumb = sentry_value_new_breadcrumb( "navigation", msg.utf8_str() );
|
||||
sentry_value_set_by_key( crumb, "category", sentry_value_new_string( "kiway.player" ) );
|
||||
sentry_value_set_by_key( crumb, "level", sentry_value_new_string( "info" ) );
|
||||
sentry_add_breadcrumb( crumb );
|
||||
if( Pgm().IsSentryOptedIn() )
|
||||
{
|
||||
wxString msg = wxString::Format( "Creating window type %d", aFrameType );
|
||||
sentry_value_t crumb = sentry_value_new_breadcrumb( "navigation", msg.utf8_str() );
|
||||
sentry_value_set_by_key( crumb, "category",
|
||||
sentry_value_new_string( "kiway.player" ) );
|
||||
sentry_value_set_by_key( crumb, "level", sentry_value_new_string( "info" ) );
|
||||
sentry_add_breadcrumb( crumb );
|
||||
}
|
||||
#endif
|
||||
|
||||
FACE_T face_type = KifaceType( aFrameType );
|
||||
|
@ -504,11 +512,15 @@ bool KIWAY::PlayerClose( FRAME_T aFrameType, bool doForce )
|
|||
return true;
|
||||
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
wxString msg = wxString::Format( "Closing window type %d", aFrameType );
|
||||
sentry_value_t crumb = sentry_value_new_breadcrumb( "navigation", msg.utf8_str() );
|
||||
sentry_value_set_by_key( crumb, "category", sentry_value_new_string( "kiway.playerclose" ) );
|
||||
sentry_value_set_by_key( crumb, "level", sentry_value_new_string( "info" ) );
|
||||
sentry_add_breadcrumb( crumb );
|
||||
if( Pgm().IsSentryOptedIn() )
|
||||
{
|
||||
wxString msg = wxString::Format( "Closing window type %d", aFrameType );
|
||||
sentry_value_t crumb = sentry_value_new_breadcrumb( "navigation", msg.utf8_str() );
|
||||
sentry_value_set_by_key( crumb, "category",
|
||||
sentry_value_new_string( "kiway.playerclose" ) );
|
||||
sentry_value_set_by_key( crumb, "level", sentry_value_new_string( "info" ) );
|
||||
sentry_add_breadcrumb( crumb );
|
||||
}
|
||||
#endif
|
||||
|
||||
if( frame->NonUserClose( doForce ) )
|
||||
|
|
|
@ -898,12 +898,15 @@ void PGM_BASE::HandleException( std::exception_ptr aPtr )
|
|||
catch( const std::exception& e )
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
sentry_value_t exc = sentry_value_new_exception( "exception", e.what() );
|
||||
sentry_value_set_stacktrace( exc, NULL, 0 );
|
||||
if( Pgm().IsSentryOptedIn() )
|
||||
{
|
||||
sentry_value_t exc = sentry_value_new_exception( "exception", e.what() );
|
||||
sentry_value_set_stacktrace( exc, NULL, 0 );
|
||||
|
||||
sentry_value_t sentryEvent = sentry_value_new_event();
|
||||
sentry_event_add_exception( sentryEvent, exc );
|
||||
sentry_capture_event( sentryEvent );
|
||||
sentry_value_t sentryEvent = sentry_value_new_event();
|
||||
sentry_event_add_exception( sentryEvent, exc );
|
||||
sentry_capture_event( sentryEvent );
|
||||
}
|
||||
#endif
|
||||
|
||||
wxLogError( wxT( "Unhandled exception class: %s what: %s" ),
|
||||
|
|
Loading…
Reference in New Issue