improve error handling

fix typo, set error directly without creating Exception
Handle CoreException from Orion #3790