2 * Copyright (C) 2012 Intel Corporation.
3 * Copyright (C) 2013-2016 Samsung Electronics.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * @brief This file describes the Ewk Web Error API.
42 * @brief The structure type that creates a type name for #Ewk_Error.
46 typedef struct _Ewk_Error Ewk_Error;
50 * \enum Ewk_Error_Code
51 * @brief Enumeration that provides an option to error codes.
56 EWK_ERROR_CODE_UNKNOWN, /**< Unknown */
57 EWK_ERROR_CODE_CANCELED, /**< User canceled */
58 EWK_ERROR_CODE_CANT_SUPPORT_MIMETYPE,
59 /**< Can't show page for this MIME Type */
60 EWK_ERROR_CODE_FAILED_FILE_IO, /**< Error */
61 EWK_ERROR_CODE_CANT_CONNECT, /**< Cannot connect to Network */
62 EWK_ERROR_CODE_CANT_LOOKUP_HOST, /**< Fail to look up host from DNS */
63 EWK_ERROR_CODE_FAILED_TLS_HANDSHAKE, /**< Fail to SSL/TLS handshake */
64 EWK_ERROR_CODE_INVALID_CERTIFICATE, /**< Received certificate is invalid */
65 EWK_ERROR_CODE_REQUEST_TIMEOUT, /**< Connection timeout */
66 EWK_ERROR_CODE_TOO_MANY_REDIRECTS, /**< Too many redirects */
67 EWK_ERROR_CODE_TOO_MANY_REQUESTS, /**< Too many requests during this load */
68 EWK_ERROR_CODE_BAD_URL, /**< Malformed url */
69 EWK_ERROR_CODE_UNSUPPORTED_SCHEME,/**< Unsupported scheme */
70 EWK_ERROR_CODE_AUTHENTICATION, /**< User authentication failed on server */
71 EWK_ERROR_CODE_INTERNAL_SERVER, /**< Web server has internal server error */
72 EWK_ERROR_CODE_CANNOTSHOWMIMETYPE = 100,
73 EWK_ERROR_CODE_CANNOTSHOWURL,
74 EWK_ERROR_CODE_FRAMELOADINTERRUPTEDBYPOLICYCHANGE,
75 EWK_ERROR_CODE_CANNOTUSERESTRICTEDPORT,
76 EWK_ERROR_CODE_CANNOTFINDPLUGIN = 200,
77 EWK_ERROR_CODE_CANNOTLOADPLUGIN,
78 EWK_ERROR_CODE_JAVAUNAVAILABLE,
79 EWK_ERROR_CODE_PLUGINCANCELLEDCONNECTION,
80 EWK_ERROR_CODE_PLUGINWILLHANDLELOAD,
85 * @brief Query failing URL for this error.
87 * @details URL that failed loading.
91 * @param[in] error The error object to query
93 * @return The URL pointer, that may be @c NULL. This pointer is\n
94 * guaranteed to be eina_stringshare, so whenever possible\n
95 * save yourself some cpu cycles and use\n
96 * eina_stringshare_ref() instead of eina_stringshare_add() or\n
100 EXPORT_API const char* ewk_error_url_get(const Ewk_Error* error);
104 * @brief Query the error code.
108 * @param[in] error The error object to query
110 * @return The error code #Ewk_Error_Code
113 EXPORT_API int ewk_error_code_get(const Ewk_Error* error);
117 * @brief Query description for this error.
121 * @param[in] error The error object to query
123 * @return The description pointer, that may be @c NULL. This pointer is\n
124 * guaranteed to be eina_stringshare, so whenever possible\n
125 * save yourself some cpu cycles and use\n
126 * eina_stringshare_ref() instead of eina_stringshare_add() or\n
130 EXPORT_API const char* ewk_error_description_get(const Ewk_Error* error);
134 * @brief Query if error should be treated as a cancellation.
138 * @param[in] error The error object to query
140 * @return @c EINA_TRUE if this error should be treated as a cancellation\n
141 * otherwise @c EINA_FALSE
144 EXPORT_API Eina_Bool ewk_error_cancellation_get(const Ewk_Error* error);
154 #endif // ewk_error_h