Forráskód Böngészése

* Improved exception handling, patch by Henrique Werlang (bug ID 37567)

git-svn-id: trunk@46425 -
michael 5 éve
szülő
commit
dfca0bf9c8
2 módosított fájl, 6 hozzáadás és 14 törlés
  1. 1 9
      utils/pas2js/libstub.pp
  2. 5 5
      utils/pas2js/stubcreator.pp

+ 1 - 9
utils/pas2js/libstub.pp

@@ -123,15 +123,7 @@ end;
 Function ExecuteStubCreator(P : PStubCreator) : Boolean; stdcall;
 
 begin
-  Result:=False;
-  try
-    TStubCreator(P).Execute;
-    Result:=True;
-  except
-    On E: Exception do
-      Writeln('Exception ',E.ClassName,' ',E.Message);
-    // Ignore
-  end;
+  Result:=TStubCreator(P).Execute;
 end;
 
 Procedure GetStubCreatorLastError(P : PStubCreator; AError : PAnsiChar;

+ 5 - 5
utils/pas2js/stubcreator.pp

@@ -75,7 +75,7 @@ type
   Public
     Constructor Create(AOwner : TComponent); override;
     Destructor Destroy; override;
-    Procedure Execute;
+    Function Execute: Boolean;
     Procedure GetLastError(Out AError,AErrorClass : String);
     // Streams take precedence over filenames. They will be freed on destroy!
     // OutputStream can be used combined with write callbacks.
@@ -202,22 +202,22 @@ begin
     Include(O,woForwardClasses);
 end;
 
-procedure TStubCreator.Execute;
-
-
+function TStubCreator.Execute: Boolean;
 begin
   FLastErrorClass:='';
   FLastError:='';
+  Result := False;
   if Defines.IndexOf('MakeStub')=-1 then
 
   Try
     DoExecute;
+
+    Result := True;
   except
     On E : Exception do
       begin
       FLastErrorClass:=E.Classname;
       FLastError:=E.Message;
-      Raise;
       end;
   end;
 end;