throw error instead of returning it in cases other than file not found