Throw exception instead of JError and codestyle