portCheck ? "true" : "false");
LoggerD("Error code: %d (%s)", ret, get_error_message(ret));
- if (ret == MESSAGE_PORT_ERROR_NONE) {
+ if (MESSAGE_PORT_ERROR_NONE == ret) {
if (portCheck) {
ReportSuccess(out);
} else {
LogAndReportError(NotFoundException("The port of the target application is not found"), out);
}
- } else if (ret == MESSAGE_PORT_ERROR_INVALID_PARAMETER) {
- LogAndReportError(
- InvalidValuesException("An input parameter contains an invalid value."), out,
- ("message_port_check_remote_port error: %d (%s)", ret, get_error_message(ret)));
- } else if (ret == MESSAGE_PORT_ERROR_OUT_OF_MEMORY) {
- LogAndReportError(
- UnknownException("Out of memory."), out,
- ("message_port_check_remote_port error: %d (%s)", ret, get_error_message(ret)));
- } else if (ret == MESSAGE_PORT_ERROR_IO_ERROR) {
+ } else if (MESSAGE_PORT_ERROR_IO_ERROR == ret) {
// IO error means that remote port does not exist
LogAndReportError(
NotFoundException("The port of the target application is not found"), out,
("message_port_check_remote_port error: %d (%s)", ret, get_error_message(ret)));
- } else if (ret == MESSAGE_PORT_ERROR_PORT_NOT_FOUND) {
- LogAndReportError(
- NotFoundException("The port of the target application is not found"), out,
- ("message_port_check_remote_port error: %d (%s)", ret, get_error_message(ret)));
} else {
LogAndReportError(
UnknownException("Unknown Error"), out,
portCheck ? "true" : "false");
LoggerD("Error code: %d (%s)", ret, get_error_message(ret));
- if (ret == MESSAGE_PORT_ERROR_NONE) {
+ if (MESSAGE_PORT_ERROR_NONE == ret) {
if (portCheck) {
ReportSuccess(out);
} else {
LogAndReportError(NotFoundException("The port of the target application is not found"), out);
}
- } else if (ret == MESSAGE_PORT_ERROR_INVALID_PARAMETER) {
- LogAndReportError(
- InvalidValuesException("An input parameter contains an invalid value."), out,
- ("message_port_check_trusted_remote_port error: %d (%s)", ret, get_error_message(ret)));
- } else if (ret == MESSAGE_PORT_ERROR_OUT_OF_MEMORY) {
- LogAndReportError(
- UnknownException("Out of memory."), out,
- ("message_port_check_trusted_remote_port error: %d (%s)", ret, get_error_message(ret)));
- } else if (ret == MESSAGE_PORT_ERROR_IO_ERROR) {
+ } else if (MESSAGE_PORT_ERROR_IO_ERROR == ret) {
// IO error means that remote port does not exist
LogAndReportError(
NotFoundException("The port of the target application is not found"), out,
("message_port_check_trusted_remote_port error: %d (%s)", ret, get_error_message(ret)));
- } else if (ret == MESSAGE_PORT_ERROR_PORT_NOT_FOUND) {
- LogAndReportError(
- NotFoundException("The port of the target application is not found"), out,
- ("message_port_check_trusted_remote_port error: %d (%s)", ret, get_error_message(ret)));
- } else if (ret == MESSAGE_PORT_ERROR_CERTIFICATE_NOT_MATCH) {
+ } else if (MESSAGE_PORT_ERROR_CERTIFICATE_NOT_MATCH == ret) {
LogAndReportError(
UnknownException("The remote application is not signed with the same certificate"), out,
("message_port_check_trusted_remote_port error: %d (%s)", ret, get_error_message(ret)));