Factor out S3 error codes into enum class