When throwing errors, check if its cli, if not then render HTML error