public static UnitResponse createError ( String errCode , Object data , String errMsg ) { if ( Group . CODE_SUCCESS . equalsIgnoreCase ( errCode ) ) { throw new IllegalArgumentException ( "Only non-success code is allowed here." ) ; } return new UnitResponse ( ) . setCode ( errCode ) . setData ( data ) . setMessage ( errMsg ) ; }
create a new error unit response instance .