#[non_exhaustive]
pub struct PostContentError { pub kind: PostContentErrorKind, /* private fields */ }
Expand description

Error type for the PostContent operation.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§kind: PostContentErrorKind

Kind of error that occurred.

Implementations§

Creates a new PostContentError.

Creates the PostContentError::Unhandled variant from any error type.

Examples found in repository?
src/operation_deser.rs (lines 248-250)
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
pub fn parse_post_content(
    op_response: &mut aws_smithy_http::operation::Response,
) -> std::result::Result<crate::output::PostContentOutput, crate::error::PostContentError> {
    #[allow(unused_variables)]
    let (response, properties) = op_response.parts_mut();
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::post_content_output::Builder::default();
        let _ = response;
        output = output.set_active_contexts(
            crate::http_serde::deser_header_post_content_post_content_output_active_contexts(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse activeContexts from header `x-amz-lex-active-contexts",
                )
            })?,
        );
        output = output.set_alternative_intents(
            crate::http_serde::deser_header_post_content_post_content_output_alternative_intents(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse alternativeIntents from header `x-amz-lex-alternative-intents",
                )
            })?,
        );
        output = output.set_audio_stream(Some(
            crate::http_serde::deser_payload_post_content_post_content_output_audio_stream(
                response.body_mut(),
            )?,
        ));
        output = output.set_bot_version(
            crate::http_serde::deser_header_post_content_post_content_output_bot_version(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse botVersion from header `x-amz-lex-bot-version",
                )
            })?,
        );
        output = output.set_content_type(
            crate::http_serde::deser_header_post_content_post_content_output_content_type(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse contentType from header `Content-Type",
                )
            })?,
        );
        output = output.set_dialog_state(
            crate::http_serde::deser_header_post_content_post_content_output_dialog_state(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse dialogState from header `x-amz-lex-dialog-state",
                )
            })?,
        );
        output = output.set_encoded_input_transcript(
            crate::http_serde::deser_header_post_content_post_content_output_encoded_input_transcript(response.headers())
                                    .map_err(|_|crate::error::PostContentError::unhandled("Failed to parse encodedInputTranscript from header `x-amz-lex-encoded-input-transcript"))?
        );
        output = output.set_encoded_message(
            crate::http_serde::deser_header_post_content_post_content_output_encoded_message(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse encodedMessage from header `x-amz-lex-encoded-message",
                )
            })?,
        );
        output = output.set_input_transcript(
            crate::http_serde::deser_header_post_content_post_content_output_input_transcript(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse inputTranscript from header `x-amz-lex-input-transcript",
                )
            })?,
        );
        output = output.set_intent_name(
            crate::http_serde::deser_header_post_content_post_content_output_intent_name(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse intentName from header `x-amz-lex-intent-name",
                )
            })?,
        );
        output = output.set_message(
            crate::http_serde::deser_header_post_content_post_content_output_message(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse message from header `x-amz-lex-message",
                )
            })?,
        );
        output = output.set_message_format(
            crate::http_serde::deser_header_post_content_post_content_output_message_format(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse messageFormat from header `x-amz-lex-message-format",
                )
            })?,
        );
        output = output.set_nlu_intent_confidence(
            crate::http_serde::deser_header_post_content_post_content_output_nlu_intent_confidence(response.headers())
                                    .map_err(|_|crate::error::PostContentError::unhandled("Failed to parse nluIntentConfidence from header `x-amz-lex-nlu-intent-confidence"))?
        );
        output = output.set_sentiment_response(
            crate::http_serde::deser_header_post_content_post_content_output_sentiment_response(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse sentimentResponse from header `x-amz-lex-sentiment",
                )
            })?,
        );
        output = output.set_session_attributes(
            crate::http_serde::deser_header_post_content_post_content_output_session_attributes(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse sessionAttributes from header `x-amz-lex-session-attributes",
                )
            })?,
        );
        output = output.set_session_id(
            crate::http_serde::deser_header_post_content_post_content_output_session_id(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse sessionId from header `x-amz-lex-session-id",
                )
            })?,
        );
        output = output.set_slot_to_elicit(
            crate::http_serde::deser_header_post_content_post_content_output_slot_to_elicit(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse slotToElicit from header `x-amz-lex-slot-to-elicit",
                )
            })?,
        );
        output = output.set_slots(
            crate::http_serde::deser_header_post_content_post_content_output_slots(
                response.headers(),
            )
            .map_err(|_| {
                crate::error::PostContentError::unhandled(
                    "Failed to parse slots from header `x-amz-lex-slots",
                )
            })?,
        );
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_post_content_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::PostContentOutput, crate::error::PostContentError> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::PostContentError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::PostContentError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "BadGatewayException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::BadGatewayException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::bad_gateway_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_bad_gateway_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::BadRequestException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::bad_request_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_bad_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ConflictException" => {
            crate::error::PostContentError {
                meta: generic,
                kind: crate::error::PostContentErrorKind::ConflictException({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::conflict_exception::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_conflict_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "DependencyFailedException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::DependencyFailedException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::dependency_failed_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_dependency_failed_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::InternalFailureException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "LimitExceededException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::LimitExceededException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::limit_exceeded_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output = output.set_retry_after_seconds(
                        crate::http_serde::deser_header_post_content_limit_exceeded_exception_retry_after_seconds(response.headers())
                                                .map_err(|_|crate::error::PostContentError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
                    );
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "LoopDetectedException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::LoopDetectedException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::loop_detected_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_loop_detected_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "NotAcceptableException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::NotAcceptableException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::not_acceptable_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_not_acceptable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "NotFoundException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::NotFoundException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::not_found_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "RequestTimeoutException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::RequestTimeoutException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::request_timeout_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_request_timeout_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "UnsupportedMediaTypeException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::UnsupportedMediaTypeException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output =
                        crate::error::unsupported_media_type_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_unsupported_media_type_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        _ => crate::error::PostContentError::generic(generic),
    })
}

Creates the PostContentError::Unhandled variant from a aws_smithy_types::Error.

Examples found in repository?
src/operation_deser.rs (line 617)
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
pub fn parse_post_content_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::PostContentOutput, crate::error::PostContentError> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::PostContentError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::PostContentError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "BadGatewayException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::BadGatewayException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::bad_gateway_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_bad_gateway_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::BadRequestException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::bad_request_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_bad_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ConflictException" => {
            crate::error::PostContentError {
                meta: generic,
                kind: crate::error::PostContentErrorKind::ConflictException({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::conflict_exception::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_conflict_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "DependencyFailedException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::DependencyFailedException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::dependency_failed_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_dependency_failed_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::InternalFailureException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "LimitExceededException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::LimitExceededException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::limit_exceeded_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output = output.set_retry_after_seconds(
                        crate::http_serde::deser_header_post_content_limit_exceeded_exception_retry_after_seconds(response.headers())
                                                .map_err(|_|crate::error::PostContentError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
                    );
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "LoopDetectedException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::LoopDetectedException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::loop_detected_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_loop_detected_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "NotAcceptableException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::NotAcceptableException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::not_acceptable_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_not_acceptable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "NotFoundException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::NotFoundException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::not_found_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "RequestTimeoutException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::RequestTimeoutException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::request_timeout_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_request_timeout_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "UnsupportedMediaTypeException" => crate::error::PostContentError {
            meta: generic,
            kind: crate::error::PostContentErrorKind::UnsupportedMediaTypeException({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output =
                        crate::error::unsupported_media_type_exception::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_unsupported_media_type_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PostContentError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        _ => crate::error::PostContentError::generic(generic),
    })
}

Returns the error message if one is available.

Returns error metadata, which includes the error code, message, request ID, and potentially additional information.

Returns the request ID if it’s available.

Returns the error code if it’s available.

Examples found in repository?
src/error.rs (line 1042)
1041
1042
1043
    fn code(&self) -> Option<&str> {
        PostContentError::code(self)
    }

Returns true if the error kind is PostContentErrorKind::BadGatewayException.

Returns true if the error kind is PostContentErrorKind::BadRequestException.

Returns true if the error kind is PostContentErrorKind::ConflictException.

Returns true if the error kind is PostContentErrorKind::DependencyFailedException.

Returns true if the error kind is PostContentErrorKind::InternalFailureException.

Returns true if the error kind is PostContentErrorKind::LimitExceededException.

Returns true if the error kind is PostContentErrorKind::LoopDetectedException.

Returns true if the error kind is PostContentErrorKind::NotAcceptableException.

Returns true if the error kind is PostContentErrorKind::NotFoundException.

Returns true if the error kind is PostContentErrorKind::RequestTimeoutException.

Returns true if the error kind is PostContentErrorKind::UnsupportedMediaTypeException.

Trait Implementations§

Creates an unhandled error variant with the given source.
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.
Returns the code for this error if one exists
Returns the ErrorKind when the error is modeled as retryable Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
Should always be Self
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more