Avoid garbage from running the unit-tests which cause exceptions.
Now, it prints just one line:
ERROR org.oransc.policyagent.clients.OscA1Client - Unexpected response for policy type: {"type":"type1"}, exception: org.json.JSONException: JSONObject["create_schema"] not found.
Change-Id: I6c5d0037b9d068a1fd069d521af1070a8ec55c54
Signed-off-by: RehanRaza <muhammad.rehan.raza@est.tech>
import java.lang.invoke.MethodHandles;
import java.util.List;
import java.lang.invoke.MethodHandles;
import java.util.List;
import org.json.JSONObject;
import org.oransc.policyagent.configuration.RicConfig;
import org.oransc.policyagent.repository.Policy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.util.UriComponentsBuilder;
import org.json.JSONObject;
import org.oransc.policyagent.configuration.RicConfig;
import org.oransc.policyagent.repository.Policy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.util.UriComponentsBuilder;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
schemaObj.put(TITLE, policyTypeId);
return Mono.just(schemaObj.toString());
} catch (Exception e) {
schemaObj.put(TITLE, policyTypeId);
return Mono.just(schemaObj.toString());
} catch (Exception e) {
- logger.error("Unexcpected response for policy type: {}", policyTypeResponse, e);
+ logger.error("Unexpected response for policy type: {}, exception: {}", policyTypeResponse, e.toString());
return Mono.error(e);
}
}
return Mono.error(e);
}
}