mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-08-02 15:42:36 +00:00
error message changed when the opened file is not swf
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class SwfOpenException extends IOException {
|
||||
|
||||
public SwfOpenException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.SWFBundle;
|
||||
import com.jpexs.decompiler.flash.SWFSourceInfo;
|
||||
import com.jpexs.decompiler.flash.SearchMode;
|
||||
import com.jpexs.decompiler.flash.SwfOpenException;
|
||||
import com.jpexs.decompiler.flash.Version;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
@@ -80,6 +81,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.logging.ConsoleHandler;
|
||||
import java.util.logging.FileHandler;
|
||||
import java.util.logging.Formatter;
|
||||
@@ -456,11 +458,24 @@ public class Main {
|
||||
SWFList swfs = null;
|
||||
try {
|
||||
Main.startWork(AppStrings.translate("work.reading.swf") + "...");
|
||||
swfs = parseSWF(sourceInfo);
|
||||
try {
|
||||
swfs = parseSWF(sourceInfo);
|
||||
} catch (ExecutionException ex) {
|
||||
Throwable cause = ex.getCause();
|
||||
if (cause instanceof SwfOpenException) {
|
||||
throw (SwfOpenException) cause;
|
||||
}
|
||||
|
||||
throw ex;
|
||||
}
|
||||
} catch (OutOfMemoryError ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
View.showMessageDialog(null, "Cannot load SWF file. Out of memory.");
|
||||
continue;
|
||||
} catch (SwfOpenException ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
View.showMessageDialog(null, ex.getMessage());
|
||||
continue;
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
View.showMessageDialog(null, "Cannot load SWF file.");
|
||||
|
||||
Reference in New Issue
Block a user