Provides a handler to process duplicate handle state
Returns a handler to process error. If the function returns nullptr the handling does not run and exception occurred