mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-30 00:56:56 +13:00
Clear file system exceptions in a special way
This commit is contained in:
parent
e373a2d241
commit
1fdb46eee5
1 changed files with 15 additions and 1 deletions
|
@ -12,7 +12,11 @@ import io.xpipe.app.update.XPipeDistributionType;
|
|||
import io.xpipe.app.util.LicenseProvider;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.nio.file.FileSystemException;
|
||||
import java.nio.file.Files;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -98,6 +102,16 @@ public class SentryErrorHandler implements ErrorHandler {
|
|||
msgField.setAccessible(true);
|
||||
msgField.set(copy, null);
|
||||
|
||||
if (copy instanceof FileSystemException) {
|
||||
var fileField = FileSystemException.class.getDeclaredField("file");
|
||||
fileField.setAccessible(true);
|
||||
fileField.set(copy, null);
|
||||
|
||||
var otherField = FileSystemException.class.getDeclaredField("other");
|
||||
otherField.setAccessible(true);
|
||||
otherField.set(copy, null);
|
||||
}
|
||||
|
||||
var causeField = Throwable.class.getDeclaredField("cause");
|
||||
causeField.setAccessible(true);
|
||||
causeField.set(copy, adjustCopy(throwable.getCause(), true));
|
||||
|
|
Loading…
Reference in a new issue