format and custom error