Skip to content

Commit 9061584

Browse files
authored
Merge pull request #497 from 1c-syntax/feature/addLogs
Добавлен пропуск битых файлов и вывод компактного описания причины
2 parents 540e043 + 7aaa331 commit 9061584

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/com/github/_1c_syntax/bsl/reader/common/xstream/ExtendXStream.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
import com.thoughtworks.xstream.converters.reflection.ReflectionConverter;
6969
import com.thoughtworks.xstream.core.ClassLoaderReference;
7070
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
71+
import com.thoughtworks.xstream.io.StreamException;
7172
import com.thoughtworks.xstream.io.xml.QNameMap;
7273
import com.thoughtworks.xstream.mapper.CachingMapper;
7374
import com.thoughtworks.xstream.mapper.CannotResolveClassException;
@@ -119,11 +120,12 @@ public Object fromXML(File file) {
119120
if (file.exists()) {
120121
try {
121122
result = super.fromXML(file);
122-
} catch (ConversionException e) {
123-
LOGGER.error("Can't read file '{}' - it's broken \n: ", file, e);
124-
throw e;
123+
} catch (ConversionException e) {
124+
LOGGER.error("Can't read file '{}' - it's broken (skipped) \n", file, e);
125125
} catch (CannotResolveClassException e) {
126-
LOGGER.debug("Can't read file '{}' - unknown class \n: ", file, e);
126+
LOGGER.debug("Can't read file '{}' - unknown class (skipped) \n", file, e);
127+
} catch (StreamException e) {
128+
LOGGER.error("Can't read file '{}' - it's broken (skipped): {}", file, e.getCause().getMessage());
127129
}
128130
}
129131
return result;

0 commit comments

Comments
 (0)