From a0b95ac74df4e058b00d23e570ffb2b018f360b8 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sun, 25 Mar 2001 23:04:14 +0000 Subject: eh, changed my mind, put the exception back in camel_url_new() svn path=/trunk/; revision=8934 --- camel/ChangeLog | 6 +----- camel/camel-session.c | 8 ++------ camel/camel-url.c | 7 ++++++- camel/camel-url.h | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index c0161d7f5b..f05ad41461 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -3,15 +3,11 @@ * camel-url.c (camel_url_new_with_base): New URL parser with full RFC1808 relative URL support. Yum. (camel_url_new): Wrapper around camel_url_new_with_base now. - Removed the CamelException since no one ever used it... - + * tests/Makefile.am: add misc subdir * tests/misc/url.c: relative URL test cases from RFC 1808 - * camel-session.c (camel_session_get_service): Update - camel_url_new call. - 2001-03-25 Jeffrey Stedfast * camel-filter-driver.c (do_copy): Don't use copy_to if the source diff --git a/camel/camel-session.c b/camel/camel-session.c index 24ca3b964d..6ec2c5f1cf 100644 --- a/camel/camel-session.c +++ b/camel/camel-session.c @@ -291,13 +291,9 @@ camel_session_get_service (CamelSession *session, const char *url_string, CamelProvider *provider; CamelService *service; - url = camel_url_new (url_string); - if (!url) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, - _("Could not parse URL `%s'"), - url_string); + url = camel_url_new (url_string, ex); + if (!url) return NULL; - } /* We need to look up the provider so we can then lookup the service in the provider's cache */ diff --git a/camel/camel-url.c b/camel/camel-url.c index 527c90da8a..bba935b7b9 100644 --- a/camel/camel-url.c +++ b/camel/camel-url.c @@ -32,6 +32,7 @@ #include #include #include "camel-url.h" +#include "camel-exception.h" #include "camel-mime-utils.h" #include "camel-object.h" @@ -267,18 +268,22 @@ copy_param (GQuark key_id, gpointer data, gpointer user_data) /** * camel_url_new: * @url_string: a URL + * @ex: a CamelException * * Parses an absolute URL. * * Return value: a CamelURL, or %NULL. **/ CamelURL * -camel_url_new (const char *url_string) +camel_url_new (const char *url_string, CamelException *ex) { CamelURL *url = camel_url_new_with_base (NULL, url_string); if (!url->protocol) { camel_url_free (url); + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, + _("Could not parse URL `%s'"), + url_string); return NULL; } return url; diff --git a/camel/camel-url.h b/camel/camel-url.h index 0ee8066137..0146b70a2d 100644 --- a/camel/camel-url.h +++ b/camel/camel-url.h @@ -50,7 +50,7 @@ typedef struct { } CamelURL; CamelURL *camel_url_new_with_base (CamelURL *base, const char *url_string); -CamelURL *camel_url_new (const char *url_string); +CamelURL *camel_url_new (const char *url_string, CamelException *ex); char *camel_url_to_string (CamelURL *url, gboolean show_password); void camel_url_free (CamelURL *url); -- cgit v1.2.3