I send mail to an employe but it’s possible that the name of employe is wrong and I have an error:“Enable to send mail, no match found in name & adress book”
I want treat this exception, just a message mus t appear and program continue to run.
How do that?
Subject: how treat an exception
Assuming this is LotusScript then:
Sub…
On Error 4294 Goto NoMatchFound
…
your code
…
Exit Sub
NoMatchFound:
Msgbox "No match was found for " +name
Resume Next
End Sub
If you need more info on Error handling then it’s covered in the designer help file.
HTH - Rufus.
Subject: RE: how treat an exception
How know the error’s number
Subject: RE: how treat an exception
Many of the errors have symbolic names defined in .lss files in the Notes program directory. This one is in lsxbeerr.lss, and its name is lsERR_NOTES_NO_MATCH.
Sometimes you can figure out from the name what error they’re talking about – sometimes it’s not obvious. In general, if you’re having an error that you want to trap and you’re not sure what its number is, you can write code such as the following:
On Error Goto Trap
…
Trap:
Messagebox "Error " & Err & " on line " & Erl & ": " & Error
Exit Sub
When the error happens, this will print out the error number. Then you edit the code again and write a specific On Error statement for that error code. It’s better for readability to use the symbolic name instead of using the number as Rufus did.
See this article for more tips.