Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: throwing exeption with custom messages (Read 3102 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

throwing exeption with custom messages

Hi!
I'm trying to throw exception from open() with my custom error explanation but I can't do it - foobar always show A critical error occured while processing files : <unknown error>

I have tried
throw new exception_io_unsupported_format("bla-bla-bla");
throw new exception_io_data("bla-bla-bla");
throw new exception_io("bla-bla-bla");

throwing exeption with custom messages

Reply #1
You are supposed to throw exceptions and not pointers to exceptions.
Microsoft Windows: We can't script here, this is bat country.

throwing exeption with custom messages

Reply #2
Quote
You are supposed to throw exceptions and not pointers to exceptions.
[a href="index.php?act=findpost&pid=372918"][{POST_SNAPBACK}][/a]

Sorry, complete misunderstood Your answer... Can You explain, please...

throwing exeption with custom messages

Reply #3
I.e. something more like
Code: [Select]
throw exception_io("bla-bla-bla");
.

 

throwing exeption with custom messages

Reply #4
Oh, I'm an idiot...
Thanx a lot