From 5a7e8dcc172beb35e416b655d036c847087d626d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 20 Dec 2023 09:09:19 +0100 Subject: [PATCH] Simplify some 'Error' invocations --- gap/carat.gi | 11 +++++------ gap/methods.gi | 8 +++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/gap/carat.gi b/gap/carat.gi index 3b7de1a..c297c8a 100644 --- a/gap/carat.gi +++ b/gap/carat.gi @@ -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." ); fi; Print( ReadAll( input ) ); CloseStream( input ); @@ -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." ); fi; # execute command @@ -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" ); 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 ); fi; end ); diff --git a/gap/methods.gi b/gap/methods.gi index 729ebf7..de662c6 100644 --- a/gap/methods.gi +++ b/gap/methods.gi @@ -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." ); fi; # execute command @@ -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 ); fi; # read Carat result from file, and remove temporary file @@ -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 ); fi; res.qclass := str{[23..Length(str)-1]};