Example usage for java.lang IndexOutOfBoundsException getMessage

List of usage examples for java.lang IndexOutOfBoundsException getMessage

Introduction

In this page you can find the example usage for java.lang IndexOutOfBoundsException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:de.xirp.mail.MailManager.java

/**
 * Returns a single {@link de.xirp.mail.Contact} for
 * the given index in the list of contacts.
 * //w  w  w  .  j  a v  a 2s .c  om
 * @param idx
 *            The index.
 * @return The desired contact or null if the index is out of
 *         bounds.
 * @see de.xirp.mail.Contact
 */
public static Contact getContact(int idx) {
    Contact c = null;
    try {
        c = contacts.get(idx);
    } catch (IndexOutOfBoundsException e) {
        logClass.debug("Debug: " + e.getMessage() + Constants.LINE_SEPARATOR, e); //$NON-NLS-1$
    }
    return c;
}

From source file:org.springframework.cloud.stream.app.trigger.DateTrigger.java

@Override
public Date nextExecutionTime(TriggerContext triggerContext) {
    Date result = null;//from ww w.  j ava2  s.com
    if (nextFireDates.size() > 0) {
        try {
            result = nextFireDates.remove(0);
        } catch (IndexOutOfBoundsException e) {
            logger.debug(e.getMessage());
        }
    }
    return result;
}

From source file:com.mifos.mifosxdroid.fragments.GroupFragment.java

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    inflater.inflate(R.menu.menu_sync, menu);
    try {// w  w  w .  ja v  a 2s . c om
        syncItem = menu.findItem(R.id.action_sync);
        if (centerId != -1) {
            List<MeetingCenter> center = new ArrayList<MeetingCenter>();
            center.addAll(
                    Select.from(MeetingCenter.class).where(Condition.prop("center_id").eq(centerId)).list());
            if (center.size() > 0 && center.get(0).getIsSynced() == 1)
                syncItem.setEnabled(false);
        }
    } catch (IndexOutOfBoundsException e) {
        Log.d(LOG_TAG, e.getMessage());
        syncItem.setEnabled(false);
    }

}

From source file:org.apache.eagle.security.hbase.parse.HbaseAuditLogParser.java

Map<String, String> parseAudit(String logLine) {
    Map<String, String> ret = null;

    Matcher loggerMatcher = loggerPattern.matcher(logLine);
    if (loggerMatcher.find()) {
        try {/*from   www.  java2s  .  com*/
            ret = new HashMap<>();
            ret.put(LOGDATE, loggerMatcher.group(LOGDATE_INDEX));
            ret.put(LOGLEVEL, loggerMatcher.group(LOGLEVEL_INDEX));
            String logAttr = loggerMatcher.group(LOGATTRS_INDEX);
            Map<String, String> attrs = parseAttribute(logAttr);
            ret.put(CONTROLLER, attrs.get(CONTROLLER));
            ret.put(REASON, attrs.get(REASON));
            ret.put(ADDRESS, attrs.get(ADDRESS));
            ret.put(REQUEST, attrs.get(REQUEST));
            Map<String, String> contextMap = parseContext(logAttr);
            ret.put(USER, contextMap.get(USER));
            ret.put(SCOPE, contextMap.get(SCOPE));
            ret.put(FAMILY, contextMap.get(FAMILY));
            ret.put(ACTION, contextMap.get(ACTION));
        } catch (IndexOutOfBoundsException e) {
            LOG.error("Got exception when parsing audit log:" + logLine + ", exception:" + e.getMessage(), e);
            ret = null;
        }
    }
    return ret;
}

From source file:org.wso2.carbon.identity.application.authentication.endpoint.tiqr.QRCode.java

/**
 * Get the tiqr QR code//from  ww  w  . ja  v  a2  s.c om
 */
protected String getQrCode(String result) {
    try {
        if (!result.contains("<img alt=\"QR\"")) {
            if (log.isDebugEnabled()) {
                log.debug("Unable to find QR code");
            }
            return null;
        }
        return result.substring(result.indexOf("<img"), result.indexOf("id=\"QR\"/>")) + "id=\"QR\"/>";
    } catch (IndexOutOfBoundsException e) {
        if (log.isDebugEnabled()) {
            log.error("Error while getting the QR code" + e.getMessage());
        }
        return null;
    }
}

From source file:com.swordlord.gozer.databinding.DataBindingMember.java

private void parseBindingMember() {
    // probably throw error in this case? -> no. DataBinding can be NULL!
    if (_strDataBindingMember == null) {
        return;/*from w  w w  .  j a va  2 s  .  co m*/
    }

    Pattern pattern = Pattern.compile(
            "^(@)?([a-z_0-9]*)(\\{[(\\?)?a-z_0-9,:='%\\s@\\[\\]\\(\\)]*\\})?(\\[[0-9]*\\])?$",
            Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);

    String[] bmElements = _strDataBindingMember.split("\\.");
    if (bmElements.length == 0) {
        LOG.error("Split of binding member return 0 elements: " + _strDataBindingMember);
        return;
    }

    // reset this, is no problem since works with lazy initialisation
    _strBindingPathName = null;
    int iElement = 0;

    for (String strBindingMemberElement : bmElements) {
        Matcher matcher = pattern.matcher(strBindingMemberElement);

        if (!matcher.find()) {
            LOG.error("DataBinding parser can't parse binding member: " + strBindingMemberElement);
            return;
        }

        if (matcher.groupCount() != 4) {
            LOG.error("Wrong group count during parsing of binding member element: " + strBindingMemberElement
                    + " in binding member: " + _strDataBindingMember);
            return;
        }

        DataBindingElement element = new DataBindingElement();

        element.setPathElement(matcher.group(2));

        String strFilter = matcher.group(3);
        if ((strFilter != null) && (strFilter.length() > 2)) {
            try {
                element.setFilter(strFilter.substring(1, strFilter.length() - 1));
            } catch (IndexOutOfBoundsException e) {
                LOG.error("strFilter is defect: " + strFilter);
                LOG.debug(e.getMessage());
                return;
            }
        }

        String strRowNumber = matcher.group(4);
        if ((strRowNumber != null) && (strRowNumber.length() > 2)) {
            try {
                element.setRowNumber(Integer.parseInt(strRowNumber.substring(1, strRowNumber.length() - 1)));
            } catch (NumberFormatException e) {
                LOG.error("RowNumber is not of type integer: " + strRowNumber);
                LOG.debug(e.getMessage());
                return;
            } catch (IndexOutOfBoundsException e) {
                LOG.error("RowNumber is defect: " + strRowNumber);
                LOG.debug(e.getMessage());
                return;
            }
        } else {
            if (iElement < bmElements.length - 1) {
                // wrong syntax, add 0 on our own
                element.setRowNumber(0);
                //element.isField(true);
            } else {
                element.setField(true);
            }
        }

        _dataBindingElements.add(element);

        iElement++;
    }
}

From source file:ru.gelin.fictionbook.reader.models.FBSimpleDocument.java

public String getText(int offset, int length) throws BadLocationException {
    try {/*w w w  . ja  v a2s  .c  o  m*/
        return new String(content, offset, length);
    } catch (IndexOutOfBoundsException e) {
        throw new BadLocationException(e.getMessage(),
                //try to guess erroneous offset
                offset < 0 || offset >= getLength() ? offset : offset + length);
    }
}

From source file:ch.cyberduck.core.azure.AzureReadFeature.java

@Override
public InputStream read(final Path file, final TransferStatus status, final ConnectionCallback callback)
        throws BackgroundException {
    try {/*from w ww.  j  av a 2 s  . c om*/
        final CloudBlob blob = session.getClient()
                .getContainerReference(containerService.getContainer(file).getName())
                .getBlobReferenceFromServer(containerService.getKey(file));
        final BlobRequestOptions options = new BlobRequestOptions();
        options.setConcurrentRequestCount(1);
        final BlobInputStream in = blob.openInputStream(AccessCondition.generateEmptyCondition(), options,
                context);
        if (status.isAppend()) {
            try {
                return StreamCopier.skip(in, status.getOffset());
            } catch (IndexOutOfBoundsException e) {
                // If offset is invalid
                throw new DefaultExceptionMappingService().map(e);
            }
        }
        return new ProxyInputStream(in) {
            @Override
            protected void handleIOException(final IOException e) throws IOException {
                if (StringUtils.equals(SR.STREAM_CLOSED, e.getMessage())) {
                    log.warn(String.format("Ignore failure %s", e));
                    return;
                }
                final Throwable cause = ExceptionUtils.getRootCause(e);
                if (cause instanceof StorageException) {
                    throw new IOException(e.getMessage(),
                            new AzureExceptionMappingService().map((StorageException) cause));
                }
                throw e;
            }
        };
    } catch (StorageException e) {
        throw new AzureExceptionMappingService().map("Download {0} failed", e, file);
    } catch (URISyntaxException e) {
        throw new NotfoundException(e.getMessage(), e);
    }
}

From source file:net.sf.taverna.t2.commandline.data.InputsHandler.java

private void regesterInputsFromFiles(Map<String, InputWorkflowPort> portMap, CommandLineOptions options,
        Path inputs, URL url) throws InvalidOptionException {
    String[] inputParams = options.getInputFiles();
    for (int i = 0; i < inputParams.length; i = i + 2) {
        String inputName = inputParams[i];
        try {/*from   w w  w  .j av a 2 s  .  com*/
            URL inputURL = new URL(url, inputParams[i + 1]);
            InputWorkflowPort port = portMap.get(inputName);

            if (port == null) {
                throw new InvalidOptionException("Cannot find an input port named '" + inputName + "'");
            }

            Path portPath = DataBundles.getPort(inputs, inputName);
            if (options.hasDelimiterFor(inputName)) {
                String delimiter = options.inputDelimiter(inputName);
                Object value = IOUtils.toString(inputURL.openStream()).split(delimiter);
                value = checkForDepthMismatch(1, port.getDepth(), inputName, value);
                setValue(portPath, value);
            } else {
                Object value = IOUtils.toByteArray(inputURL.openStream());
                value = checkForDepthMismatch(0, port.getDepth(), inputName, value);
                setValue(portPath, value);
            }
        } catch (IndexOutOfBoundsException e) {
            throw new InvalidOptionException("Missing input filename for input " + inputName);
        } catch (IOException e) {
            throw new InvalidOptionException("Could not read input " + inputName + ": " + e.getMessage());
        }
    }
}

From source file:org.lmn.fc.frameworks.starbase.plugins.observatory.ui.instruments.commands.configuration.UploadControllerOS.java

/***********************************************************************************************
 * Upload the specified data to the AVR Controller's Bootloader.
 * Optionally fill the unused code memory with 0xff.
 * Capture the version number of the bootloader.
 *
 * @param target/*w  w w  .j ava2s.co m*/
 * @param broadcastaddress
 * @param data
 * @param fillunused
 * @param logentries
 * @param errors
 *
 * @return ResponseMessageStatus
 */

private static ResponseMessageStatus uploadToAVRBootloader(final TargetCPU target,
        final String broadcastaddress, final List<Byte> data, final boolean fillunused,
        final List<String> logentries, final List<String> errors) {
    final String SOURCE = "UploadControllerOS.uploadToAVRBootloader() ";
    final int RETRY_COUNT = 5;
    final byte COMMAND_IDENTIFY = 0x49; // ASCII 'I'
    final byte COMMAND_PROGRAM = 0x50; // ASCII 'P'
    final byte COMMAND_ACK = 0x41; // ASCII 'A'
    final byte COMMAND_NACK = 0x4e; // ASCII 'N'
    UDPClient clientUDP;
    ResponseMessageStatus responseMessageStatus;

    clientUDP = null;
    responseMessageStatus = ResponseMessageStatus.SUCCESS;

    try {
        final String strHostname;
        final InetAddress inetAddress;
        List<Byte> listPayload;
        byte[] arrayResponse;

        // Set up the UDPClient
        // Note that UDP requests are often restricted to the current subnet
        strHostname = broadcastaddress;
        inetAddress = InetAddress.getByName(strHostname);

        // SocketException
        clientUDP = new UDPClient(inetAddress, target.getLocalPort(), target.getRemotePort(),
                target.getTimeoutMillis());
        clientUDP.getSocket().setBroadcast(true);

        // The host program transmits an 'identify' packet to kick off communication with any devices in bootloader mode
        // The MAC address in this packet is all zeroes meaning any bootloader should respond
        // I <0x00> <0x00> <0x00> <0x00> <0x00> <0x00>
        listPayload = new ArrayList<Byte>(7);
        listPayload.add(COMMAND_IDENTIFY);
        listPayload.add((byte) 0x00);
        listPayload.add((byte) 0x00);
        listPayload.add((byte) 0x00);
        listPayload.add((byte) 0x00);
        listPayload.add((byte) 0x00);
        listPayload.add((byte) 0x00);

        // Prepare to get the Bootloader Version
        logentries.clear();

        // Send the packet, do NOT call UDPClient.connect() !
        // If the payload is longer than the maximum reliable length of a UDP Datagram
        // (8192) bytes then an IOException is thrown
        clientUDP.send(ArrayUtils.toPrimitive(listPayload.toArray(new Byte[listPayload.size()])));

        // The host then waits for timeout for any/all devices in bootloader mode to respond
        // This method blocks until a UDP Datagram is received
        // This Command is being executed on its own SwingWorker, so this doesn't matter...
        // IOException
        arrayResponse = clientUDP.receive();

        // The devices respond with an 'acknowledge' packet and its MAC address
        // There are additional data giving more details about the target processor
        // A <6 bytes Target MAC> <ChipFlashPageSize> <ProcessorID> <VersionNumber>
        // Ideally the host should capture all responses and allow the user to select which device to program,
        // at the moment this host simply uses the first (and normally only) response.

        if ((arrayResponse != null) && (arrayResponse.length > 0)) {
            final int INDEX_ACK = 0;
            final int INDEX_MAC_ADDRESS = 1;
            final int INDEX_PAGE_SIZE = 7;
            final int INDEX_PACKET_NUMBER = 7;
            final int INDEX_ID = 8;
            final int INDEX_VERSION = 9;
            final byte[] arrayMAC;
            final List<Byte> listMAC;
            final int intChipFlashPageSize;
            final byte byteProcessorID;
            final byte byteVersion;

            LOGGER.debug(LOADER_PROPERTIES.isStarinetDebug(),
                    "[identify_response=" + Utilities.byteArrayToSpacedHex(arrayResponse) + "]");

            // Read the MAC address of the responder, and convert to a List
            arrayMAC = ArrayUtils.subarray(arrayResponse, INDEX_MAC_ADDRESS, INDEX_MAC_ADDRESS + 6);
            listMAC = new ArrayList<Byte>(6);

            for (int intMACIndex = 0; intMACIndex < 6; intMACIndex++) {
                listMAC.add(arrayMAC[intMACIndex]);
            }

            // ChipFlashPageSize
            intChipFlashPageSize = arrayResponse[INDEX_PAGE_SIZE] << 4;

            // ProcessorID
            byteProcessorID = arrayResponse[INDEX_ID];

            // Version Number (did not exist prior to v1.1)
            if (arrayResponse.length > INDEX_VERSION) {
                byteVersion = arrayResponse[INDEX_VERSION];
            } else {
                byteVersion = 0x00;
            }
            logentries.add(Utilities.byteToTwoHexString(byteVersion));

            // Check that we have exactly the right target
            if ((byteProcessorID == target.getID()) && (intChipFlashPageSize == target.getPagesize())) {
                // Now program the data in PageSize packets
                if ((data != null) && (!data.isEmpty())) {
                    final int intSizeOfLastPacket;
                    final int intPacketCount;
                    boolean boolSuccessfulPacket;

                    // Record the Codesize (before padding) as the second entry
                    logentries.add(Integer.toString(data.size()));

                    // Fill the unused bytes in the code memory if requested
                    if (fillunused) {
                        while (data.size() < target.getCodesize()) {
                            data.add(target.getFill());
                        }
                    }

                    // Only now do we know the page size required for this processor
                    // Pad the data List to be multiple of PageSize bytes
                    intSizeOfLastPacket = data.size() % intChipFlashPageSize;

                    if ((intSizeOfLastPacket != intChipFlashPageSize) && (data.size() < target.getCodesize())) {
                        for (int intPadding = 0; ((intPadding < (intChipFlashPageSize - intSizeOfLastPacket))
                                && (data.size() < target.getCodesize())); intPadding++) {
                            data.add(target.getFill());
                        }
                    }

                    // Calculate the number of packets to send
                    intPacketCount = data.size() / intChipFlashPageSize;
                    boolSuccessfulPacket = true;

                    for (int intPacketIndex = 0; ((intPacketIndex < intPacketCount)
                            && (boolSuccessfulPacket)); intPacketIndex++) {
                        final int intPacketAddress;
                        boolean boolKeepRetrying;

                        intPacketAddress = intPacketIndex * intChipFlashPageSize;

                        // The program packet is made up as follows:
                        // P
                        // <6 bytes Dest MAC>
                        // <PacketNumber>
                        // <TargetAddressMSB>
                        // <TargetAddressLSB>
                        // <DataBytesLengthMSB>
                        // <DataBytesLengthLSB>
                        // <DataBytes>
                        // Code words in DataBytes are sent little-endian, i.e. LSB first
                        // but that order will have been set during compilation to create the HEX file

                        listPayload = new ArrayList<Byte>(12 + intChipFlashPageSize);

                        // Program Command 'P'
                        listPayload.add(COMMAND_PROGRAM);

                        // MAC Address
                        listPayload.addAll(listMAC);

                        // PacketNumber
                        listPayload.add((byte) intPacketIndex);

                        // Target Address MSB, LSB
                        listPayload.add((byte) ((intPacketAddress & 0xff00) >> 8));
                        listPayload.add((byte) ((intPacketAddress & 0x00ff)));

                        // DataBytesLength MSB, LSB
                        listPayload.add((byte) ((intChipFlashPageSize & 0xff00) >> 8));
                        listPayload.add((byte) ((intChipFlashPageSize & 0x00ff)));

                        // DataBytes
                        listPayload.addAll(
                                data.subList(intPacketAddress, intPacketAddress + intChipFlashPageSize));

                        LOGGER.debug(LOADER_PROPERTIES.isStarinetDebug(),
                                "[send] [packet_index=" + intPacketIndex + "] [packet_address="
                                        + intPacketAddress + "] [pagesize=" + intChipFlashPageSize + "]");
                        LOGGER.debug(LOADER_PROPERTIES.isStarinetDebug(), HexFileHelper.dumpHex(listPayload,
                                intPacketAddress, HexFileHelper.DUMP_BYTES_PER_LINE));
                        boolKeepRetrying = true;

                        // Start the retry loop
                        for (int intRetryIndex = 0; ((intRetryIndex < RETRY_COUNT)
                                && (boolKeepRetrying)); intRetryIndex++) {
                            // Send the packet to the remote Port
                            clientUDP.send(
                                    ArrayUtils.toPrimitive(listPayload.toArray(new Byte[listPayload.size()])));

                            // Wait here for Ack or Nack
                            arrayResponse = clientUDP.receive();

                            if ((arrayResponse != null) && (arrayResponse.length > 0)) {
                                // Was it an Ack or Nack from the correct MAC address?
                                // A
                                // <6 bytes Source MAC>
                                // <PacketNumber>

                                LOGGER.debug(LOADER_PROPERTIES.isStarinetDebug(), "[program_response="
                                        + Utilities.byteArrayToSpacedHex(arrayResponse) + "]");

                                // See if it was an Ack
                                if ((arrayResponse.length >= 8) && (COMMAND_ACK == arrayResponse[INDEX_ACK])) {
                                    final byte[] arrayAckMAC;
                                    final List<Byte> listAckMAC;

                                    // Read the MAC address in the Ack
                                    arrayAckMAC = ArrayUtils.subarray(arrayResponse, INDEX_MAC_ADDRESS,
                                            INDEX_MAC_ADDRESS + 6);
                                    listAckMAC = new ArrayList<Byte>(6);

                                    for (int intMACIndex = 0; intMACIndex < 6; intMACIndex++) {
                                        listAckMAC.add(arrayAckMAC[intMACIndex]);
                                    }

                                    // Check the the MAC address is correct
                                    if (listMAC.equals(listAckMAC)) {
                                        // Check the packet number
                                        if (arrayResponse[INDEX_PACKET_NUMBER] == (byte) intPacketIndex) {
                                            // Success, so stop the retry loop and carry on
                                            boolKeepRetrying = false;
                                            boolSuccessfulPacket = true;
                                        } else {
                                            // Faulty packet index, so retry?
                                            boolKeepRetrying = true;
                                            boolSuccessfulPacket = false;
                                            errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP
                                                    + METADATA_RESULT + "Faulty Packet Index, Retry [index="
                                                    + arrayResponse[7] + TERMINATOR);
                                        }
                                    } else {
                                        // Faulty MAC address, so retry
                                        boolKeepRetrying = true;
                                        boolSuccessfulPacket = false;
                                        errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP
                                                + METADATA_RESULT + "Faulty MAC Address, Retry [index="
                                                + intRetryIndex + TERMINATOR);
                                    }
                                } else if (COMMAND_NACK == arrayResponse[INDEX_ACK]) {
                                    // A Nack must always cause a retry
                                    boolKeepRetrying = true;
                                    boolSuccessfulPacket = false;
                                    errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP
                                            + METADATA_RESULT + "NACK Packet, Retry [index=" + intRetryIndex
                                            + TERMINATOR);
                                } else {
                                    // An unknown packet type, so give up
                                    boolKeepRetrying = false;
                                    boolSuccessfulPacket = false;
                                    responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
                                    errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP
                                            + METADATA_RESULT + "Unknown packet type ("
                                            + arrayResponse[INDEX_ACK] + ")" + TERMINATOR);
                                }
                            } else {
                                // A fatal error, since no Ack or Nack packet, so no sense in retrying again
                                boolKeepRetrying = false;
                                boolSuccessfulPacket = false;
                                responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
                                errors.add(
                                        METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP + METADATA_RESULT
                                                + "Program Acknowledge was empty or NULL" + TERMINATOR);
                            }
                        }
                    }
                } else {
                    // Record the Codesize (before padding) as the second entry
                    logentries.add("0");

                    responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
                    errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP + METADATA_RESULT
                            + "No data to transmit" + TERMINATOR);
                }
            } else {
                responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
                errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP + METADATA_RESULT
                        + "Invalid AVR ProcessorID or PageSize [id=" + byteProcessorID + "] [pagesize="
                        + intChipFlashPageSize + TERMINATOR);
            }
        } else {
            responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
            errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP + METADATA_RESULT
                    + "Identify Acknowledge was empty or NULL" + TERMINATOR);
        }
    }

    catch (IndexOutOfBoundsException exception) {
        responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
        errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP + METADATA_EXCEPTION
                + ObservatoryInstrumentDAOInterface.ERROR_ARRAY_INDEX + TERMINATOR + SPACE + METADATA_MESSAGE
                + exception.getMessage() + TERMINATOR);
    }

    catch (PortUnreachableException exception) {
        responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
        errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP + METADATA_EXCEPTION
                + ObservatoryInstrumentDAOInterface.ERROR_PORT + TERMINATOR + SPACE + METADATA_MESSAGE
                + exception.getMessage() + TERMINATOR);
    }

    catch (SocketException exception) {
        responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
        errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP + METADATA_EXCEPTION
                + ObservatoryInstrumentDAOInterface.ERROR_SOCKET + TERMINATOR + SPACE + METADATA_MESSAGE
                + exception.getMessage() + TERMINATOR);
    }

    catch (IllegalArgumentException exception) {
        responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
        errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP + METADATA_EXCEPTION
                + ObservatoryInstrumentDAOInterface.ERROR_PARSE_INPUT + TERMINATOR + SPACE + METADATA_MESSAGE
                + exception.getMessage() + TERMINATOR);
    }

    catch (SecurityException exception) {
        responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
        errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP + METADATA_EXCEPTION
                + ObservatoryInstrumentDAOInterface.ERROR_SECURITY + TERMINATOR + SPACE + METADATA_MESSAGE
                + exception.getMessage() + TERMINATOR);
    }

    catch (UnknownHostException exception) {
        responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
        errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP + METADATA_EXCEPTION
                + ObservatoryInstrumentDAOInterface.ERROR_UNKNOWN_HOST + TERMINATOR + SPACE + METADATA_MESSAGE
                + exception.getMessage() + TERMINATOR);
    }

    catch (SocketTimeoutException exception) {
        responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
        errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP + METADATA_EXCEPTION
                + ObservatoryInstrumentDAOInterface.ERROR_TIMEOUT + TERMINATOR + SPACE + METADATA_MESSAGE
                + exception.getMessage() + TERMINATOR);
    }

    catch (IllegalBlockingModeException exception) {
        responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
        errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP + METADATA_EXCEPTION
                + ObservatoryInstrumentDAOInterface.ERROR_ILLEGAL_MODE + TERMINATOR + SPACE + METADATA_MESSAGE
                + exception.getMessage() + TERMINATOR);
    }

    catch (IOException exception) {
        responseMessageStatus = ResponseMessageStatus.PREMATURE_TERMINATION;
        errors.add(METADATA_TARGET_STARINET + METADATA_ACTION_REQUEST_UDP + METADATA_EXCEPTION
                + ObservatoryInstrumentDAOInterface.ERROR_IO + TERMINATOR + SPACE + METADATA_MESSAGE
                + exception.getMessage() + TERMINATOR);
    }

    finally {
        // Make sure that the Socket is released
        if (clientUDP != null) {
            clientUDP.close();
        }
    }

    return (responseMessageStatus);
}