]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
polymorphic error codes.
authorMarcus Watts <mwatts@redhat.com>
Tue, 3 Nov 2015 00:43:36 +0000 (19:43 -0500)
committerPritha Srivastava <prsrivas@redhat.com>
Tue, 16 May 2017 04:35:56 +0000 (10:05 +0530)
commitb640ded886b7ac1996f9adbe150a6f5af48d67fc
treeb79544946461f1ec7a423aa76fc1e0f3306c3257
parent6f1bf0dd9b57362ffa8d4bdff3641ae87c6674ea
polymorphic error codes.

make set_req_state_err a method of req_state

get rid of params.perr; it's never used

rgw - polymorphic error object.

polymorphic error object: this way sts, which has additional error fields,
and its own xml format for how errors should be produced, can overload
the base rgw_err class.

STL fixup: use real mappings for error mappings, not a linear search.
insubstantiate error mappings exactly once in src/rgw/rgw_common.cc, instead
of multiple copies from every source file that includes src/rgw/rgw_http_errors.h.

remove dump_errno(s, err) - it was never used, and the code looked bogus.

move rgw_http_error_to_errno from header to rgw_rest_client.cc,
the only place it's used.
move rgw_http_status_code and http_codes to rgw_rest.cc,
the only place it's used.

base class (rgw_err) implements s3 errors; swift & sts errors use
the base class and overlay their own additional error codes to
the ones recognized by the base class.

For a while, I was trying to just have a "generic" abort_early() that
used dump_more.  Now, I have an op aware form that works the old way.
I would like the http routines to known less about "op" structures,
which is why I'm making this distinction.

Splitting up generic and s3 flavors of some things:
rgw_rest_init() - split into s3 and generic forms.
end_header: s3 vs generic forms: generic form uses dump_more.
abort_early: s3 vs generic forms: generic form uses dump_more, error_content.

And fixing some mistakes from the merge:
Fixup: should not have deleted dump_errno() local storage forms.
Fixup:RGWRESTFlusher  - take a dump_more to make it generic.
Fixup: need RGWRESTOp::send_response()

Move swift_err up; use it in bulkdelete_respond
I Think I don't need s->prot_flags when using swift_err.

Signed-off-by: Marcus Watts <mwatts@redhat.com>
25 files changed:
src/rgw/librgw.cc
src/rgw/rgw_common.cc
src/rgw/rgw_common.h
src/rgw/rgw_cr_rados.cc
src/rgw/rgw_http_errors.h
src/rgw/rgw_log.cc
src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_process.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h
src/rgw/rgw_rest.cc
src/rgw/rgw_rest.h
src/rgw/rgw_rest_config.cc
src/rgw/rgw_rest_log.cc
src/rgw/rgw_rest_metadata.cc
src/rgw/rgw_rest_opstate.cc
src/rgw/rgw_rest_realm.cc
src/rgw/rgw_rest_replica_log.cc
src/rgw/rgw_rest_s3.cc
src/rgw/rgw_rest_s3.h
src/rgw/rgw_rest_swift.cc
src/rgw/rgw_rest_swift.h
src/rgw/rgw_swift_auth.cc
src/rgw/rgw_tools.cc