[Windows XP+] Try .. Catch .. EndTry - Error Handling

Share your advanced PureBasic knowledge/code with the community.
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: [Windows XP+] Try .. Catch .. EndTry - Error Handling

Post by Little John »

Thank you so much, Danilo!

Regards, Little John
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: [Windows XP+] Try .. Catch .. EndTry - Error Handling

Post by Kwai chang caine »

Your codes are very often incredible :shock:
Sometime, i ask to me, if you not rewrite a clone of PB :lol: :lol:
Thanks DANILO for sharing 8)
ImageThe happiness is a road...
Not a destination
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: [Windows XP+] Try .. Catch .. EndTry - Error Handling

Post by Lunasole »

Thanks, it is very cool and useful and just helped me a lot to avoid whole program crash in cases when loaded external dll fails 8) (and I guess will help a lot in many other cases where annoying crashes can appear at minor errors)
The OnError library doesn't seems to be handy usable with such cases
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
Dawgmann
User
User
Posts: 40
Joined: Wed Jul 17, 2019 5:32 pm

Re: [Windows XP+] Try .. Catch .. EndTry - Error Handling

Post by Dawgmann »

@Danilo

How do we acquire the error number and error message when using your Try/Catch error handling?
Sample code?
Dudemeister
User
User
Posts: 29
Joined: Sat Oct 26, 2019 6:48 pm

Re: [Windows XP+] Try .. Catch .. EndTry - Error Handling

Post by Dudemeister »

Hmm...
I came across this and it peaked my interest a bit.
Seems to work.
Dudemeister
User
User
Posts: 29
Joined: Sat Oct 26, 2019 6:48 pm

Re: [Windows XP+] Try .. Catch .. EndTry - Error Handling

Post by Dudemeister »

I've tried this a few times and it seems to work well at trapping critical errors, then allowing the user to continue.
But like the previous poster, I can't figure out how to acquire the error information (error code and description/message) from the 'CurrentExceptionInfo' variable. Does anyone have any ideas how to extract these 2 items of information?

Anyone?
Post Reply