More detailed error and helper function