Skip to content

Commit

Permalink
Issue #62: Improved error handling in TUIRibbon.Load()
Browse files Browse the repository at this point in the history
  • Loading branch information
Joachim Marder committed Feb 24, 2017
1 parent 81b6805 commit 920a309
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Lib/UIRibbon.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ function TUIRibbon.LoadSettings(const Filename: String): Boolean;

procedure TUIRibbon.Load();
resourcestring
sErrorLoadingRibbonRessource = 'An error occurred while trying to load the Ribbon resource "%s": %s';
sErrorLoadingRibbonRessource = 'An error occurred while trying to load the Ribbon resource "%s": %s (%x)';
var
Inst: THandle;
lForm: TCustomForm;
Expand All @@ -1023,16 +1023,16 @@ procedure TUIRibbon.Load();
try
FFramework.LoadUI(Inst, PChar(FResourceName + '_RIBBON'));
FLoaded := True;
if Assigned(FOnLoaded) then
FOnLoaded(Self);
if roAutoPreserveState in Options then
LoadRibbonSettings();
except
on E: EOleException do begin
E.Message := Format(sErrorLoadingRibbonRessource, [Self.ResourceName, e.Message]);
E.Message := Format(sErrorLoadingRibbonRessource, [Self.ResourceName, e.Message, e.ErrorCode]);
raise;
end;
end;//try..except
if Assigned(FOnLoaded) then
FOnLoaded(Self);
if roAutoPreserveState in Options then
LoadRibbonSettings();

lForm := GetParentForm(Self);
// Set the background color for the form if not yet defined. Use the same
Expand Down

0 comments on commit 920a309

Please sign in to comment.