package com.sharefile.api.exceptions;

import javax.net.ssl.HttpsURLConnection;

import com.sharefile.api.SFV3Error;

@SuppressWarnings("serial")
public class SFV3ErrorException extends SFAbstractException
{
	private final SFV3Error mV3Error;
	
	public SFV3ErrorException(SFV3Error v3error) 
	{
		super(new RuntimeException());
		mV3Error = v3error;
	}
	
	public SFV3Error getV3Error()
	{
		return mV3Error;
	}
	
	public boolean isAuthException()
	{
		boolean result = false;
		
		if(mV3Error.httpResponseCode ==  HttpsURLConnection.HTTP_UNAUTHORIZED)
		{
			result = true;
		}
		
		return result;
	}
}
@@ -43,77 +43,77 @@
 ort 
-javax.net.ssl.HttpsURLConnection;%0A%0Aimport com.sharefile.api.SFV3Error
+com.sharefile.api.SFV3Error;%0A%0Aimport javax.net.ssl.HttpsURLConnection
 ;%0A%0A@
@@ -593,10 +593,1004 @@
 sult;%0A%09%7D
+%0A%0A    @Override%0A    public String getMessage() %7B%0A        if ( mV3Error==null ) return super.getMessage();%0A%0A        StringBuilder str = new StringBuilder(%22http:%22 + String.valueOf(mV3Error.httpResponseCode));%0A        if ( mV3Error.code!=null && !mV3Error.code.isEmpty()) %7B%0A            str.append(%22; code:%22);%0A            str.append(mV3Error.code);%0A        %7D%0A%0A        if ( mV3Error.mExtraInfo!=null && !mV3Error.mExtraInfo.isEmpty() ) %7B%0A            str.append(%22; extra:%22);%0A            str.append(mV3Error.mExtraInfo);%0A        %7D%0A%0A        if ( mV3Error.message!=null ) %7B%0A            if ( mV3Error.message.lang!=null && !mV3Error.message.lang.isEmpty() ) %7B%0A                str.append(%22; lang:%22);%0A                str.append(mV3Error.message.lang);%0A            %7D%0A            if ( mV3Error.message.value!=null && !mV3Error.message.value.isEmpty() ) %7B%0A                str.append(%22; value:%22);%0A                str.append(mV3Error.message.value);%0A            %7D%0A        %7D%0A%0A        return str.toString();%0A    %7D
 %0A%7D

add error information to the exception