Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi Prism/Compiler    [ Add a report in this area ]  
Report #:  98691   Status: Open
Internal Error for try..except on System.ServiceModel.FaultException<T>
Project:  Embarcadero Prism Build #:  4.0.25.791
Version:    2010.1 Submitted By:   M Andersson
Report Type:  Basic functionality failure Date Reported:  9/8/2011 9:20:32 AM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   287540
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
I'm calling a WFC service and want to catch all the different errors. When I catch generic  FaultException<T> the project will not compile.

try    
  result := client.MakeSimpleSearch(text);
  client.Close;
except  
  on e: FaultException<NoRecordFoundDetails> do
  ..
end;

if I use the non-generic form "on e: FaultException" it will compile, but then I will not get the information about different errors.
Steps to Reproduce:
namespace TestTryCompile;

interface

uses
  System.ServiceModel;

type  
  Class1 = public class
  public
    procedure Method1();
  end;

  Class2 = public class(Exception)  
  end;
  
implementation

procedure Class1.Method1();
begin
  try
  except
    on e: System.ServiceModel.FaultException<Class2> do
    begin
    end;
  end;
end;

end.

This will not build in my environment, same error as in real project.
Workarounds
Using nongeneric FaultException, but that is not satisfactory.
Attachment
None
Comments

None

Server Response from: ETNACODE01