Commit fe7c8686 authored by Nugine's avatar Nugine
Browse files

refactor(codegen/error): show error codes

parent f127d497
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -153,6 +153,11 @@ pub fn codegen(model: &smithy::Model) {
        "",
    ]);

    for err in errors.values() {
        g!("// {}", err.code);
    }
    g!();

    g!("#[derive(Debug, Clone, PartialEq, Eq)]");
    g!("#[non_exhaustive]");
    g!("pub enum S3ErrorCode {{");
+82 −0
Original line number Diff line number Diff line
@@ -5,6 +5,88 @@
use bytestring::ByteString;
use hyper::StatusCode;

// AccessDenied
// AccountProblem
// AllAccessDisabled
// AmbiguousGrantByEmailAddress
// AuthorizationHeaderMalformed
// BadDigest
// BucketAlreadyExists
// BucketAlreadyOwnedByYou
// BucketNotEmpty
// CredentialsNotSupported
// CrossLocationLoggingProhibited
// EntityTooLarge
// EntityTooSmall
// ExpiredToken
// IllegalVersioningConfigurationException
// IncompleteBody
// IncorrectNumberOfFilesInPostRequest
// InlineDataTooLarge
// InternalError
// InvalidAccessKeyId
// InvalidAddressingHeader
// InvalidArgument
// InvalidBucketName
// InvalidBucketState
// InvalidDigest
// InvalidEncryptionAlgorithmError
// InvalidLocationConstraint
// InvalidObjectState
// InvalidPart
// InvalidPartOrder
// InvalidPayer
// InvalidPolicyDocument
// InvalidRange
// InvalidRequest
// InvalidSOAPRequest
// InvalidSecurity
// InvalidStorageClass
// InvalidTargetBucketForLogging
// InvalidToken
// InvalidURI
// KeyTooLongError
// MalformedACLError
// MalformedPOSTRequest
// MalformedXML
// MaxMessageLengthExceeded
// MaxPostPreDataLengthExceededError
// MetadataTooLarge
// MethodNotAllowed
// MissingAttachment
// MissingContentLength
// MissingRequestBodyError
// MissingSecurityElement
// MissingSecurityHeader
// NoLoggingStatusForKey
// NoSuchBucket
// NoSuchBucketPolicy
// NoSuchKey
// NoSuchLifecycleConfiguration
// NoSuchUpload
// NoSuchVersion
// NotImplemented
// NotSignedUp
// OperationAborted
// PermanentRedirect
// PreconditionFailed
// Redirect
// ReplicationConfigurationNotFoundError
// RequestIsNotMultiPartContent
// RequestTimeTooSkewed
// RequestTimeout
// RequestTorrentOfBucketError
// RestoreAlreadyInProgress
// ServiceUnavailable
// SignatureDoesNotMatch
// SlowDown
// TemporaryRedirect
// TokenRefreshRequired
// TooManyBuckets
// UnexpectedContent
// UnresolvableGrantByEmailAddress
// UserKeyMustBeSpecified

#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum S3ErrorCode {