public function OnErrorMessageReachParent($result)
    {
        if ($result instanceof SerializableException) {
            if ($result instanceof SerializableFatalException) {
                //Fatal exception should be handled separate
                //This should be tracked on parent
                throw new ThreadFatalException($result->getMessage() . PHP_EOL . PHP_EOL . $result->getTraceAsString(), $result->getCode());
            }
            //best is to log all the exception information here
            //you can also inject the variables into normal exception using reflection
            throw new \Exception($result->getMessage() . PHP_EOL . PHP_EOL . $result->getTraceAsString(), $result->getCode());
        }
        //if it is an error object created from another handler just return it.
        //this only applies to usage of distinct ErrorHandlers
        return $result;
    }
public function OnErrorMessageReachParent($result)
    {
        if ($result instanceof SerializableException) {
            if ($result instanceof SerializableFatalException) {
                //Fatal exception should be handled separate
                //This should be tracked on parent
                throw new ThreadFatalException($result->getMessage() . PHP_EOL . PHP_EOL . $result->getTraceAsString(), $result->getCode());
            }
            //best is to log all the exception information here
            //you can also inject the variables into normal exception using reflection
            throw new \Exception($result->getMessage() . PHP_EOL . PHP_EOL . $result->getTraceAsString(), $result->getCode());
        }
        //if it is an error object created from another handler just return it.
        //this only applies to usage of distinct ErrorHandlers
        return $result;
    }
public function OnErrorMessageReachParent ( $ result ) { if ( $ result instanceof SerializableException ) { if ( $ result instanceof SerializableFatalException ) { //Fatal exception should be handled separate
 //This should be tracked on parent
 throw new ThreadFatalException ( $ result -> getMessage ( ) . PHP_EOL . PHP_EOL . $ result -> getTraceAsString ( ) , $ result -> getCode ( ) ) ; } //best is to log all the exception information here
 //you can also inject the variables into normal exception using reflection
 throw new \ Exception ( $ result -> getMessage ( ) . PHP_EOL . PHP_EOL . $ result -> getTraceAsString ( ) , $ result -> getCode ( ) ) ; } //if it is an error object created from another handler just return it.
 //this only applies to usage of distinct ErrorHandlers
 return $ result ; }
The result from @see IThreadErrorHandler::OnUncaughtException is given as Parameter in the parent thread
You can decide how to handle this
If you like you could throw an \Exeption to the caller or you can just return a value
indicating that function is failed. You can also trigger error here if you like to
@param mixed $result
@throws \Exception
@return mixed
The result from