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

Exception thrown when disk fills up #20

Open
eapache opened this issue May 29, 2012 · 1 comment
Open

Exception thrown when disk fills up #20

eapache opened this issue May 29, 2012 · 1 comment

Comments

@eapache
Copy link

eapache commented May 29, 2012

To reproduce, create a tiny tmpfs, and have Bunyan write a few log messages to stdout, redirecting that to a file in the tmpfs. An exception is thrown. Wrapping it in an empty try/catch as follows at least prevents the exception, although I'm not sure if there's anything else that should be done in this case.

Index: lib/bunyan.js
===================================================================
--- lib/bunyan.js   (revision 8822)
+++ lib/bunyan.js   (working copy)
@@ -646,7 +646,10 @@
     if (s.level <= level) {
       xxx('writing log rec "%s" to "%s" stream (%d <= %d)', obj.msg, s.type,
         s.level, level);
-      s.stream.write(str);
+      try {
+        s.stream.write(str);
+      } catch (e3) {
+      }
     }
   });
 }
@michaelnisi
Copy link
Contributor

I'd say throwing an exception is fine here, don't you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants