2 * Copyright 2001-2006 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file saml/exceptions.h
23 #ifndef __saml_exceptions_h__
24 #define __saml_exceptions_h__
26 #include <saml/base.h>
27 #include <xmltooling/exceptions.h>
32 class SAML_API EntityDescriptor;
33 class SAML_API RoleDescriptor;
36 DECL_XMLTOOLING_EXCEPTION(BindingException,SAML_EXCEPTIONAPI(SAML_API),opensaml,xmltooling::XMLToolingException,Exceptions in SAML binding processing);
39 * Attaches metadata-derived information as exception properties and optionally
40 * rethrows the object. The following named properties are attached, when possible:
43 * <dt>providerId</dt> <dd>The unique ID of the entity</dd>
44 * <dt>errorURL</dt> <dd>The error support URL of a random role</dd>
45 * <dt>contactName</dt> <dd>A formatted support or technical contact name</dd>
46 * <dt>contactEmail</dt> <dd>A contact email address</dd>
49 * @param e pointer to exception object
50 * @param entity pointer to entity
51 * @param rethrow true iff the exception should be rethrown
53 void SAML_API annotateException(
54 xmltooling::XMLToolingException* e, const saml2md::EntityDescriptor* entity, bool rethrow=true
58 * Attaches metadata-derived information as exception properties and optionally
59 * rethrows the object. The following named properties are attached, when possible:
62 * <dt>providerId</dt> <dd>The unique ID of the entity</dd>
63 * <dt>errorURL</dt> <dd>The error support URL of the role</dd>
64 * <dt>contactName</dt> <dd>A formatted support or technical contact name</dd>
65 * <dt>contactEmail</dt> <dd>A contact email address</dd>
68 * @param e pointer to exception object
69 * @param entity pointer to role
70 * @param rethrow true iff the exception should be rethrown
72 void SAML_API annotateException(
73 xmltooling::XMLToolingException* e, const saml2md::RoleDescriptor* role, bool rethrow=true
77 #endif /* __saml_exceptions_h__ */