Done.   Added Logging for exception. Returning "" in catch block for now to avoid the code down the road crashing. To return null some other code in the wrapper needs to be reviewed and updated to handle nulls gracefully.  The original implementation was also returning "" in case of bad  data.  (Shouldn't happened anyway as we create urls in the wrapper.)
On Feb 24, 2014, at 4:55 AM, thobach <notifications@github.com> wrote:

> In src/com/mambu/apisdk/util/URLHelper.java:
> 
> >  	 */
> >  	public String createUrl(String details) {
> >  		details = details == null ? "" : details;
> > -		return WEB_PROTOCOL + "://" + domainName + "/api/" + details;
> > +
> > +		// URL String must be url-encoded to handle spaces and UTF-8 chars (See MBU-4669, implemented in Mambu 3.4)
> > +		String encodedUrl;
> > +		try {
> > +			URI uri = new URI(WEB_PROTOCOL, domainName, API_ENDPOINT + details, null);
> > +			encodedUrl = uri.toString();
> > +
> > +		} catch (URISyntaxException e) {
> > +
> > +			encodedUrl = WEB_PROTOCOL + "://" + domainName + API_ENDPOINT + details;
> If it's only because of the encoding then you can add a comment in the catch block to note why this exception is ignored and don't try to manually build the URL. The documentation of the URI constructor states that a URISyntaxException is thrown when the resulting URI violates a RFC, so I'd rather print an exception and return null or don't catch that exception in that method at all, but let it be handled by the calling method.
> 
> —
> Reply to this email directly or view it on GitHub.
>