backcompat http-exception handling by middleware