src/com/shrewdify/diaroser/impl/PeerImpl.java
public byte[] handleError(int errorType,Hashtable<Integer, Avp>hs, byte[] temp) throws IOException{
			HashSet<Avp> avpset = null;
			switch(errorType){
			case -1:
				avpset = par.copyforResponse(Constants.ONE,Constants.UNKNOWNREALM_CODE, hs);
				return par.merge(par.encodeAvpSet(avpset), temp);				
			case -2:
				avpset = par.copyforResponse(Constants.ONE,Constants.UNKNOWNAUTHID_CODE, hs);
				return par.merge(par.encodeAvpSet(avpset), temp);					
			case -4:
				avpset = par.copyforResponse(Constants.ONE,Constants.SESSIONEXITS_CODE, hs);
				return par.merge(par.encodeAvpSet(avpset), temp);					
			case -5:
				avpset = par.copyforResponse(Constants.ONE,Constants.UNKNOWN_SESSION_CODE, hs);
				return par.merge(par.encodeAvpSet(avpset), temp);					
			default:
				return null;

			}
		}
/**
		 * 
		 * @param errorType
		 * @param hs
		 * @param temp
		 * @return
		 * @throws IOException
		 * 
		 * It generates response for all the errors. It receives its header and error code. Based on this It generates the error response and gives back.
		 */


It generates response for all the errors. It receives its header and error code. Based on this It generates the error response and gives back.
It generates response for all the errors . It receives its header and error code . Based on this It generates the error response and gives back .
public byte[] handleError(int errorType,Hashtable<Integer, Avp>hs, byte[] temp) throws IOException{
			HashSet<Avp> avpset = null;
			switch(errorType){
			case -1:
				avpset = par.copyforResponse(Constants.ONE,Constants.UNKNOWNREALM_CODE, hs);
				return par.merge(par.encodeAvpSet(avpset), temp);				
			case -2:
				avpset = par.copyforResponse(Constants.ONE,Constants.UNKNOWNAUTHID_CODE, hs);
				return par.merge(par.encodeAvpSet(avpset), temp);					
			case -4:
				avpset = par.copyforResponse(Constants.ONE,Constants.SESSIONEXITS_CODE, hs);
				return par.merge(par.encodeAvpSet(avpset), temp);					
			case -5:
				avpset = par.copyforResponse(Constants.ONE,Constants.UNKNOWN_SESSION_CODE, hs);
				return par.merge(par.encodeAvpSet(avpset), temp);					
			default:
				return null;
			}
		}
public byte [ ] handleError ( int errorType , Hashtable < Integer , Avp > hs , byte [ ] temp ) throws IOException { HashSet < Avp > avpset = null ; switch ( errorType ) { case - 1 : avpset = par . copyforResponse ( Constants . ONE , Constants . UNKNOWNREALM_CODE , hs ) ; return par . merge ( par . encodeAvpSet ( avpset ) , temp ) ; case - 2 : avpset = par . copyforResponse ( Constants . ONE , Constants . UNKNOWNAUTHID_CODE , hs ) ; return par . merge ( par . encodeAvpSet ( avpset ) , temp ) ; case - 4 : avpset = par . copyforResponse ( Constants . ONE , Constants . SESSIONEXITS_CODE , hs ) ; return par . merge ( par . encodeAvpSet ( avpset ) , temp ) ; case - 5 : avpset = par . copyforResponse ( Constants . ONE , Constants . UNKNOWN_SESSION_CODE , hs ) ; return par . merge ( par . encodeAvpSet ( avpset ) , temp ) ; default : return null ; } }
@param errorType
 @param hs
 @param temp
 @return
 @throws IOException
@param errorType @param hs @param temp @return @throws IOException