Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent internal error reporting of FileNotFoundException during serialization #605

Merged
merged 3 commits into from
Sep 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## TBD

* Prevent internal error reporting of FileNotFoundException during serialization
[#605](https://github.com/bugsnag/bugsnag-android/pull/605)

## 4.20.0 (2019-09-25)

* Record StorageManager cache behaviour in internal error reports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
Expand Down Expand Up @@ -117,6 +118,8 @@ String write(@NonNull JsonStream.Streamable streamable) {
stream.value(streamable);
Logger.info(String.format("Saved unsent payload to disk (%s) ", filename));
return filename;
} catch (FileNotFoundException exc) {
Logger.warn("Ignoring FileNotFoundException - unable to create file", exc);
} catch (Exception exc) {
if (delegate != null) {
delegate.onErrorIOFailure(exc, new File(filename), "Crash report serialization");
Expand Down