test: reduce duplicate exception logs and wrapping
-/*
- * Copyright 2014 MovingBlocks
- *
- * Licensed 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.
- */
+// Copyright 2021 The Terasology Foundation
+// SPDX-License-Identifier: Apache-2.0
package org.terasology.engine;
import com.google.common.collect.Sets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.terasology.gestalt.assets.management.AssetManager;
import org.terasology.engine.context.Context;
import org.terasology.engine.context.internal.ContextImpl;
import org.terasology.engine.core.paths.PathManager;
import org.terasology.engine.recording.RecordAndReplayCurrentStatus;
import org.terasology.engine.registry.CoreRegistry;
+import org.terasology.gestalt.assets.management.AssetManager;
import org.terasology.gestalt.naming.Name;
import java.io.IOException;
@@ -50,10 +37,13 @@ public Environment(Name... moduleNames) {
try {
reset(Sets.newHashSet(moduleNames));
} catch (Exception e) {
- logger.error("Error", e);
+ if (e instanceof RuntimeException) {
+ throw (RuntimeException) e;
+ } else {
throw new RuntimeException(e);
}
}
+ }
protected void reset(Set<Name> moduleNames) throws Exception {
this.context = new ContextImpl();
