public static ObjectResult newErrorResult ( String errMsg , String objID ) { ObjectResult result = new ObjectResult ( ) ; result . setStatus ( Status . ERROR ) ; result . setErrorMessage ( errMsg ) ; if ( ! Utils . isEmpty ( objID ) ) { result . setObjectID ( objID ) ; } return result ; }
Create an ObjectResult with a status of ERROR and the given error message and optional object ID .