View Issue Details

IDProjectCategoryView StatusLast Update
0005366JEDI VCL00 JVCL Componentspublic2010-11-29 23:17
Reportertrident_jobAssigned Tojfudickar 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.40 
Target VersionFixed in Version 
Summary0005366: EIdURIException Exception not caught in TJvProgramVersionCheck
DescriptionWhen executing TJvProgramVersionCheck.Execute(), the EIdURIException is not caught by the object and propagate to the main's application thread. There is no way to catch it !
Additional InformationTest with JVCL340CompleteJCL221-Build3845 (previous version have the same issue).
During TJvProgramVersionCheck.Execute(), a first description file is downloaded. Then, the user accept to update its application and the update file is downloaded.
The prolem occurs if the URI doesn't exists (or if the protocol is empty).
An exc exception is created but there is no way to intercept it during the Excecute as this portion of code is inside a newly created thread. So only the Main applciation thread receive it.

The function creating this exception is:

[code]
function TIdURI.GetFullURI(const AOptionalFields: TIdURIOptionalFieldsSet): String;
var
  LURI: String;
begin
  if FProtocol = '' then begin
    raise EIdURIException.Create(RSURINoProto);
  end;

  if FHost = '' then begin
    raise EIdURIException.Create(RSURINoHost);
  end;
...
[/code]

TagsNo tags attached.

Activities

trident_job

2010-10-14 14:37

reporter   ~0017898

if my analyze is ok, one thing I'd like to see if the exception being caught in the new thread by TJvProgramVersionCheck and raised again so I can handle it !

jfudickar

2010-10-15 20:03

developer   ~0017906

Could you provide a sample showing this behaviour?
And which internet components did you use.

2010-10-21 21:55

 

JvProgramVersionCheck_0005366.7z (811,393 bytes)

trident_job

2010-10-21 22:06

reporter   ~0017935

ok, I've attached a demo project (source + exe).
Let me explain the issue now :

* Start the application "JvProgramVersionCheck_0005366.exe"
* In the Form.OnShow() procedure, I'm calling JvProgramVersionCheck1.Execute()
 * The application downloads a description file (where all application releases are listed)
 * The application detects a new version (v2.0)
 * The application suggest to upgrade application to v2.0 (just select the EXECUTE button)
 * Application tries to download the V2 file, but the URI is unknown (I've intentionaly set a wrong URI).
  * Here, a, Application Error popup is displayed 'Exception EidURIException in module ...'. THIS IS THE BUG !

I would like to intercept this exception, so I've added a try/except during the JvProgramVersionCheck1.Execute(), but it's catching nothing !

I don't want to user to see this exception, but I cannot handle it.
That's the issue !

trident_job

2010-10-21 22:08

reporter   ~0017936

This demo was made with JVCL340CompleteJCL221-Build3845 installed with USE_3RDPARTY_INDY and USE_3RDPARTY_INDY10.

jfudickar

2010-10-31 21:28

developer   ~0017981

The update was helpfull. Thanks.

I've commited some changes and now the exception is raised outside the thread again.

The only interesting thing that i not understand is in the following code
procedure TForm1.FormShow(Sender: TObject);
begin
  // Go to Application folder to create version information files
  ChDir(ExtractFilePath(Application.ExeName));
  try
    JvProgramVersionCheck1.Execute;
  except
     on e:Exception do
      begin
        MessageDlg(e.Message, mtWarning, [mbOK], 0);
      end;
  end;
end;

The debugger steps into the line "MessageDlg" and shows the exception message, but not dialog is shown.

How are your results?

Kind regards
Jens

AHUser

2010-11-28 01:43

developer   ~0018200

@Jens: The MessageDlg doesn't show a dialog if Application.Terminated is True.

jfudickar

2010-11-28 19:18

developer   ~0018225

@Andreas: Without sitting on my compiler, why is Application.Terminated True??

trident_job

2010-11-29 21:00

reporter   ~0018227

With the JVCL3-2010-11-29 (daily build), the demo works.
=> it shows the message 'Exception caught !'.
I'm uploading the new demo EXE fixed (just in case you want to see the result).

So the fix is approved from my point of view.

@jfudickar: I tested with your 'on exception' code, it works for me.

2010-11-29 21:01

 

JvProgramVersionCheck_0005366_fixed.7z (810,720 bytes)

Issue History

Date Modified Username Field Change
2010-10-14 14:35 trident_job New Issue
2010-10-14 14:37 trident_job Note Added: 0017898
2010-10-15 20:03 jfudickar Note Added: 0017906
2010-10-21 21:55 trident_job File Added: JvProgramVersionCheck_0005366.7z
2010-10-21 22:06 trident_job Note Added: 0017935
2010-10-21 22:08 trident_job Note Added: 0017936
2010-10-31 21:28 jfudickar Note Added: 0017981
2010-10-31 21:29 jfudickar Status new => feedback
2010-10-31 21:29 jfudickar Assigned To => jfudickar
2010-11-28 01:43 AHUser Note Added: 0018200
2010-11-28 19:18 jfudickar Note Added: 0018225
2010-11-29 21:00 trident_job Note Added: 0018227
2010-11-29 21:01 trident_job File Added: JvProgramVersionCheck_0005366_fixed.7z
2010-11-29 23:17 jfudickar Status feedback => resolved
2010-11-29 23:17 jfudickar Resolution open => fixed