mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 07:54:36 +00:00
Print error message when opening a trace from command line fails.
This commit is contained in:
parent
1354205db8
commit
5461427493
@ -217,7 +217,25 @@ int main( int argc, char** argv )
|
|||||||
printf( " %s -a address [-p port]\n", argv[0] );
|
printf( " %s -a address [-p port]\n", argv[0] );
|
||||||
exit( 0 );
|
exit( 0 );
|
||||||
}
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
initFileOpen = std::unique_ptr<tracy::FileRead>( tracy::FileRead::Open( argv[1] ) );
|
initFileOpen = std::unique_ptr<tracy::FileRead>( tracy::FileRead::Open( argv[1] ) );
|
||||||
|
}
|
||||||
|
catch( const tracy::UnsupportedVersion& e )
|
||||||
|
{
|
||||||
|
fprintf( stderr, "The file you are trying to open is from the future version.\n" );
|
||||||
|
exit( 1 );
|
||||||
|
}
|
||||||
|
catch( const tracy::NotTracyDump& e )
|
||||||
|
{
|
||||||
|
fprintf( stderr, "The file you are trying to open is not a tracy dump.\n" );
|
||||||
|
exit( 1 );
|
||||||
|
}
|
||||||
|
catch( const tracy::LegacyVersion& e )
|
||||||
|
{
|
||||||
|
fprintf( stderr, "The file you are trying to open is from a legacy version.\n" );
|
||||||
|
exit( 1 );
|
||||||
|
}
|
||||||
if( !initFileOpen )
|
if( !initFileOpen )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Cannot open trace file: %s\n", argv[1] );
|
fprintf( stderr, "Cannot open trace file: %s\n", argv[1] );
|
||||||
|
Loading…
Reference in New Issue
Block a user