You need to modify a little the function raise() to take into account the optional title property passed in the onError event.