Re: Minor bug and suggested fix - 1.2 and 1.3.5

From: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
To: "'Mark A(dot) Taff'" <mark(at)libertycreek(dot)net>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Minor bug and suggested fix - 1.2 and 1.3.5
Date: 2002-02-14 16:26:30
Message-ID: FED2B709E3270E4B903EB0175A49BCB1047592@dogbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Sounds good. Care to give it a go?

Regards, Dave.
-----Original Message-----
From: Mark A. Taff [mailto:mark(at)libertycreek(dot)net]
Sent: 14 February 2002 16:15
To: Dave Page; pgadmin-hackers
Subject: RE: [pgadmin-hackers] Minor bug and suggested fix - 1.2 and 1.3.5

We could just rewrite EndMsg to accept an optional parameter (Optional ByVal
szMsg As String) where szMsg is "Done with errors - ". This could be set in
LogError, then we test for the passed value and modify the status bar
message as required.

Mark Taff

-----Original Message-----
From: Dave Page [mailto:dpage(at)vale-housing(dot)co(dot)uk]
Sent: Thursday, February 14, 2002 8:05 AM
To: 'Mark A. Taff'; pgadmin-hackers
Subject: RE: [pgadmin-hackers] Minor bug and suggested fix - 1.2 and 1.3.5


-----Original Message-----
From: Mark A. Taff [mailto:mark(at)libertycreek(dot)net]
Sent: 14 February 2002 15:48
To: pgadmin-hackers
Subject: [pgadmin-hackers] Minor bug and suggested fix - 1.2 and 1.3.5
All,
I've found a minor bug in 1.2 and 1.3.5. When an uncorrected
error occurs and LogError is called after StartMsg has been called, EndMsg
is not always called, and so the cursor does not always return to a normal
cursor. Rather than trying to check and correct for this throughout the
code, I've just done it once in the LogError sub. I've pasted patched code
based on 1.3.5 for your consideration below.

Regards,

Mark Taff

*** Begin patch for pgAdmin2.basMisc.LogError v1.3.5 ***

Public Sub LogError(lError As Long, szError As String, szRoutine As String)
'No logging here, if anythings going wrong then we want the real error

frmMain.svr.LogEvent "Error in " & szRoutine & ": " & lError & " - " &
szError, etErrors
MsgBox "An error has occured in " & szRoutine & ":" & vbCrLf & vbCrLf &
"Number: " & lError & vbCrLf & "Description: " & szError, vbExclamation,
App.Title & " Error"

'If we get here, EndMsg may not fire, so give the user a normal cursor...
Screen.MousePointer = vbDefault

End Sub

*** End patch ***

It might be an idea to set the status message sensibly as well - perhaps
take a look at EndMsg and see what else it does. I *think* the only other
thing is display the timings....


Regards, Dave.

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Mark A. Taff 2002-02-14 16:32:47 Re: Minor bug and suggested fix - 1.2 and 1.3.5
Previous Message Mark A. Taff 2002-02-14 16:15:16 Re: Minor bug and suggested fix - 1.2 and 1.3.5