Skip to content

Commit

Permalink
Simplify some 'Error' invocations
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Dec 20, 2023
1 parent 93cd688 commit 5a7e8dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
11 changes: 5 additions & 6 deletions gap/carat.gi
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ InstallGlobalFunction( CaratShowFile, function( filename )
local input;
input := InputTextFile( filename );
if input = fail then
Error( Concatenation( "File ", filename, " not found." ) );
Error( "File ", filename, " not found." );

Check warning on line 572 in gap/carat.gi

View check run for this annotation

Codecov / codecov/patch

gap/carat.gi#L572

Added line #L572 was not covered by tests
fi;
Print( ReadAll( input ) );
CloseStream( input );
Expand Down Expand Up @@ -615,7 +615,7 @@ InstallGlobalFunction( CaratCommand, function( command, args, outfile )
# find executable
program := Filename( CARAT_BIN_DIR, command );
if program = fail then
Error( Concatenation( "Carat program ", command, " not found." ) );
Error( "Carat program ", command, " not found." );

Check warning on line 618 in gap/carat.gi

View check run for this annotation

Codecov / codecov/patch

gap/carat.gi#L618

Added line #L618 was not covered by tests
fi;

# execute command
Expand All @@ -630,13 +630,12 @@ InstallGlobalFunction( CaratCommand, function( command, args, outfile )
CaratShowFile( outfile ); # contains usage advice
else
CaratShowFile( outfile );
Error( Concatenation( "Carat program ", command,
" failed with error code ", String(err), " and the above output" ) );
Error( "Carat program ", command,
" failed with error code ", err, " and the above output" );

Check warning on line 634 in gap/carat.gi

View check run for this annotation

Codecov / codecov/patch

gap/carat.gi#L633-L634

Added lines #L633 - L634 were not covered by tests
fi;
fi;
if err < 0 and args <> "-h" then
Error( Concatenation( "Carat program ", command,
" failed with error code ", String(err) ) );
Error( "Carat program ", command, " failed with error code ", err );

Check warning on line 638 in gap/carat.gi

View check run for this annotation

Codecov / codecov/patch

gap/carat.gi#L638

Added line #L638 was not covered by tests
fi;

end );
Expand Down
8 changes: 3 additions & 5 deletions gap/methods.gi
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ InstallGlobalFunction( BravaisGroupsCrystalFamily, function( symb )
command := "Bravais_catalog";
program := Filename( CARAT_BIN_DIR, command );
if program = fail then
Error( Concatenation( "Carat program ", command, " not found." ) );
Error( "Carat program ", command, " not found." );

Check warning on line 464 in gap/methods.gi

View check run for this annotation

Codecov / codecov/patch

gap/methods.gi#L464

Added line #L464 was not covered by tests
fi;

# execute command
Expand All @@ -474,8 +474,7 @@ InstallGlobalFunction( BravaisGroupsCrystalFamily, function( symb )
CaratShowFile( resfile ); # contains usage advice
fi;
if err < 0 then
Error( Concatenation( "Carat program ", command,
" failed with error code ", String(err) ) );
Error( "Carat program ", command, " failed with error code ", err );

Check warning on line 477 in gap/methods.gi

View check run for this annotation

Codecov / codecov/patch

gap/methods.gi#L477

Added line #L477 was not covered by tests
fi;

# read Carat result from file, and remove temporary file
Expand Down Expand Up @@ -564,8 +563,7 @@ InstallGlobalFunction( CaratQClassCatalog, function( grp , mode )
# get the QClass name
str := CaratReadLine( input );
if str{[1..22]} <> "Name of this Q-class: " then
Error( Concatenation(
"Carat program Q_catalog failed with message\n", str ) );
Error( "Carat program Q_catalog failed with message\n", str );

Check warning on line 566 in gap/methods.gi

View check run for this annotation

Codecov / codecov/patch

gap/methods.gi#L566

Added line #L566 was not covered by tests
fi;
res.qclass := str{[23..Length(str)-1]};

Expand Down

0 comments on commit 5a7e8dc

Please sign in to comment.