public void QueryException() { QueryException queryException = new MalformedContinuationTokenException(); QueryResponseCore queryResponse = QueryResponseFactory.CreateFromException(queryException); Assert.AreEqual(HttpStatusCode.BadRequest, queryResponse.StatusCode); Assert.IsNotNull(queryResponse.ErrorMessage); }
public void ExceptionFromTryCatch() { QueryException queryException = new MalformedContinuationTokenException(); TryCatch <object> tryCatch = TryCatch <object> .FromException(queryException); QueryResponseCore queryResponse = QueryResponseFactory.CreateFromException(tryCatch.Exception); Assert.AreEqual(HttpStatusCode.BadRequest, queryResponse.StatusCode); Assert.IsNotNull(queryResponse.ErrorMessage); Assert.IsTrue(queryResponse.ErrorMessage.Contains(nameof(ExceptionFromTryCatch))); }
public override CosmosException Visit(MalformedContinuationTokenException malformedContinuationTokenException) => CosmosExceptionFactory.CreateBadRequestException( message: malformedContinuationTokenException.Message, stackTrace: malformedContinuationTokenException.StackTrace, innerException: malformedContinuationTokenException);
public abstract TResult Visit(MalformedContinuationTokenException malformedContinuationTokenException);