Bug in hkDefaultError

Bug in hkDefaultError

The documentation states that overriding showMessage in hkDefaultError is the way to go, alas said function is not virtual. This obviously makes overriding it by deriving form hkDefaultError not as easy as it sounds :)

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting - alamaise
The documentation states that overriding showMessage in hkDefaultError is the way to go, alas said function is not virtual. This obviously makes overriding it by deriving form hkDefaultError not as easy as it sounds :)

Hi alamaise,

This sounds like an error in the docs. You want to override the message method instead. Can you tell me where in the docs you saw this? I see it in the comments about hkDefaultError, but is there another place it says this?

Thanks,
Jay

Hi,

no, thats where I found it. I do beleive that the docs state the intention and the signature of the showMessage method is bugged. :)

1. It is a lot easier to override showMessage, judging from the parameters it gets, than message
2. It is moved to protected so deriving classes have easy access

So imho its just a missing virtual in hkDefaultError :)

Best Reply

Thanks alamaise, that does seem weird. I'll log an issue against it. In the mean time, if you really want to override showMessage (be sure that you really do. It's mostly meant as a helper function) you'll have to build your own hkDefaultError implementation by looking at hkError and implementing those virtual functions.

-Jay

Just to add to my previous post. The idea is that showMessage is called from with the message method. Inside the message method you get to possibly ignore different messages, describe them (ie, what = "Warning"), decide if you want to report a stack trace, etc. The showMessage just stupidly writes the message to a file and extracts stack traces.

-Jay

Quoting - JayAtHavok
Just to add to my previous post. The idea is that showMessage is called from with the message method. Inside the message method you get to possibly ignore different messages, describe them (ie, what = "Warning"), decide if you want to report a stack trace, etc. The showMessage just stupidly writes the message to a file and extracts stack traces.

-Jay

Yes, that is why I believe that the error is in the missing virtual and not the documentation. hkDefaultError already provides many nice features like filtering and an implementaiton for the sections, stuff you usually do not want to implement yourself if you consider hkDefaultError being useful. All you want is a way to get the final output to someplace you like.

If you're reimplementing hkDefaultError always anyways, there is no need for it.

If you can, please update this post if it truely is a bug and gets fixed. I am curious. :D

Thanks!

Leave a Comment

Please sign in to add a comment. Not a member? Join today