fix: properly set error code on console exception event