mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-16 01:00:34 +01:00
IDE: handle an exception thrown by all options parser.
git-svn-id: trunk@42384 -
This commit is contained in:
parent
960505e772
commit
2a45b388fc
@ -615,7 +615,7 @@ begin
|
||||
// Option was not found, try separating the parameter.
|
||||
// ToDo: figure out the length in a more clever way.
|
||||
if (Length(aOptAndValue) < 3) or (aOptAndValue[1] <> '-') then
|
||||
raise Exception.Create('Invalid option & value ' + aOptAndValue);
|
||||
raise Exception.CreateFmt('Invalid option or value "%s".', [aOptAndValue]);
|
||||
if aOptAndValue[2] in ['e', 'd', 'u', 'I', 'k', 'o'] then
|
||||
OptLen := 2
|
||||
else
|
||||
|
||||
@ -116,18 +116,23 @@ procedure TCompilerOtherOptionsFrame.btnAllOptionsClick(Sender: TObject);
|
||||
var
|
||||
AllOpts: TfrmAllCompilerOptions;
|
||||
begin
|
||||
FOptionsReader.FromCustomOptions(memoCustomOptions.Lines);
|
||||
AllOpts := TfrmAllCompilerOptions.Create(Nil);
|
||||
try
|
||||
AllOpts.OptionsReader:=FOptionsReader;
|
||||
if AllOpts.ShowModal = mrOK then
|
||||
begin
|
||||
// Synchronize with custom options memo
|
||||
AllOpts.ToCustomOptions(memoCustomOptions.Lines);
|
||||
memoCustomOptions.Invalidate;
|
||||
FOptionsReader.FromCustomOptions(memoCustomOptions.Lines);
|
||||
AllOpts := TfrmAllCompilerOptions.Create(Nil);
|
||||
try
|
||||
AllOpts.OptionsReader:=FOptionsReader;
|
||||
if AllOpts.ShowModal = mrOK then
|
||||
begin
|
||||
// Synchronize with custom options memo
|
||||
AllOpts.ToCustomOptions(memoCustomOptions.Lines);
|
||||
memoCustomOptions.Invalidate;
|
||||
end;
|
||||
finally
|
||||
AllOpts.Free;
|
||||
end;
|
||||
finally
|
||||
AllOpts.Free;
|
||||
except
|
||||
on E: Exception do
|
||||
ShowMessage('Error parsing custom options: '+E.Message);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -613,7 +618,6 @@ begin
|
||||
CompilerExecutable := EnvironmentOptions.GetParsedCompilerFilename;
|
||||
if ReadAndParseOptions <> mrOK then
|
||||
ShowMessage(ErrorMsg);
|
||||
//FromCustomOptions(FCustomOptions);
|
||||
except
|
||||
on E: Exception do
|
||||
ShowMessage('Error parsing options: '+E.Message);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user