Trap compile errors and fail gracefully