Skip to content
Snippets Groups Projects
Commit f2e60eb9 authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Fixed exception handling after Hipparchus migration.

parent 201eba47
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@
*/
package org.orekit.rugged.api;
import org.hipparchus.exception.LocalizedCoreFormats;
import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import java.io.IOException;
......@@ -628,9 +629,7 @@ public class RuggedBuilder {
createInterpolatorIfNeeded();
new ObjectOutputStream(storageStream).writeObject(scToBody);
} catch (IOException ioe) {
// TODO hipparchus migration : change to the appropriate message
// throw new RuggedException(ioe, LocalizedFormats.SIMPLE_MESSAGE, ioe.getMessage());
throw new RuggedException(ioe, RuggedMessages.DEBUG_DUMP_ACTIVATION_ERROR, ioe.getLocalizedMessage());
throw new RuggedException(ioe, LocalizedCoreFormats.SIMPLE_MESSAGE, ioe.getMessage());
}
}
......
......@@ -17,6 +17,7 @@
package org.orekit.rugged.errors;
import org.hipparchus.analysis.differentiation.DerivativeStructure;
import org.hipparchus.exception.LocalizedCoreFormats;
import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
......@@ -277,9 +278,7 @@ public class DumpReplayer {
}
reader.close();
} catch (IOException ioe) {
// TODO hipparchus migration : change to the appropriate message
// throw new RuggedException(ioe, LocalizedFormats.SIMPLE_MESSAGE, ioe.getLocalizedMessage());
throw new RuggedException(ioe, RuggedMessages.DEBUG_DUMP_ACTIVATION_ERROR, file.getAbsolutePath(), ioe.getLocalizedMessage());
throw new RuggedException(ioe, LocalizedCoreFormats.SIMPLE_MESSAGE, ioe.getLocalizedMessage());
}
}
......@@ -390,9 +389,7 @@ public class DumpReplayer {
return rugged;
} catch (IOException ioe) {
// TODO hipparchus migration : change to the appropriate message
// throw new RuggedException(ioe, LocalizedFormats.SIMPLE_MESSAGE, ioe.getLocalizedMessage());
throw new RuggedException(ioe, RuggedMessages.DEBUG_DUMP_ACTIVATION_ERROR, ioe.getLocalizedMessage());
throw new RuggedException(ioe, LocalizedCoreFormats.SIMPLE_MESSAGE, ioe.getLocalizedMessage());
} catch (SecurityException e) {
// this should never happen
throw RuggedException.createInternalError(e);
......
/* Copyright 2013-2016 CS Systèmes d'Information
* Licensed to CS Systèmes d'Information (CS) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* CS licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.orekit.rugged.errors;
import java.util.Locale;
import org.hipparchus.exception.Localizable;
/** This interface specified methods implemented by localized exception classes.
* @author Luc Maisonobe
*/
public interface LocalizedException {
/** Gets the message in a specified locale.
* @param locale Locale in which the message should be translated
* @return localized message
*/
String getMessage(final Locale locale);
/** Get the localizable specifier of the error message.
* @return localizable specifier of the error message
*/
Localizable getSpecifier();
/** Get the variable parts of the error message.
* @return a copy of the variable parts of the error message
*/
Object[] getParts();
}
......@@ -17,6 +17,7 @@
package org.orekit.rugged.errors;
import org.hipparchus.exception.Localizable;
import org.hipparchus.exception.LocalizedException;
import org.hipparchus.exception.MathRuntimeException;
import java.text.MessageFormat;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment