check error level in error handler
Merge pull request #2364 from gureedo/error-handler

check error level in error handler