From 098032e81580d001cdb84f99934f220977eb0657 Mon Sep 17 00:00:00 2001 From: larryl Date: Fri, 29 Feb 2008 03:43:43 +0000 Subject: [PATCH] Raise an exception when cURL dynamic library not found. git-svn-id: https://svn.origo.ethz.ch/eiffelstudio/trunk/Src/library/cURL@72546 8089f293-4706-0410-a29e-feb5c42a2edf --- curl_dynamic_library_not_found_exception.e | 40 ++++++++++++++++++++++ curl_easy_externals.e | 4 +++ curl_externals.e | 4 +++ 3 files changed, 48 insertions(+) create mode 100644 curl_dynamic_library_not_found_exception.e diff --git a/curl_dynamic_library_not_found_exception.e b/curl_dynamic_library_not_found_exception.e new file mode 100644 index 00000000..7686dbd7 --- /dev/null +++ b/curl_dynamic_library_not_found_exception.e @@ -0,0 +1,40 @@ +indexing + description: "[ + Exception which means cURL dynamic library (*.dll on Windows, + *.so on Linux and ...) not found. + ]" + status: "See notice at end of class." + legal: "See notice at end of class." + date: "$Date$" + revision: "$Revision$" + +class + CURL_DYNAMIC_LIBRARY_NOT_FOUND_EXCEPTION + +inherit + DEVELOPER_EXCEPTION + +create + make + +feature {NONE} -- Initialization + + make is + -- Creation method. + do + set_message ("cURL dynamic library not found.") + end + +indexing + library: "cURL: Library of reusable components for Eiffel." + copyright: "Copyright (c) 1984-2006, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 356 Storke Road, Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" + +end diff --git a/curl_easy_externals.e b/curl_easy_externals.e index 3fdb7e36..752b03cb 100644 --- a/curl_easy_externals.e +++ b/curl_easy_externals.e @@ -18,10 +18,14 @@ feature -- Command -- Declared as curl_easy_init(). local l_api: POINTER + l_exception: CURL_DYNAMIC_LIBRARY_NOT_FOUND_EXCEPTION do l_api := api_loader.safe_load_api (module_name, "curl_easy_init") if l_api /= default_pointer then Result := c_init (l_api) + else + create l_exception.make + l_exception.raise end ensure exists: Result /= default_pointer diff --git a/curl_externals.e b/curl_externals.e index d430736e..5bcdce7e 100644 --- a/curl_externals.e +++ b/curl_externals.e @@ -18,10 +18,14 @@ feature -- Command -- Declared as curl_global_init(). local l_ptr: POINTER + l_exception: CURL_DYNAMIC_LIBRARY_NOT_FOUND_EXCEPTION do l_ptr := api_loader.safe_load_api (module_name, "curl_global_init") if l_ptr /= default_pointer then c_curl_global_init (l_ptr, {CURL_GLOBAL_CONSTANTS}.curl_global_all); + else + create l_exception.make + l_exception.raise end end