Skip to content
Snippets Groups Projects
Commit fb08ced8 authored by Richard Alam's avatar Richard Alam
Browse files

- add exception logging on jws

parent d33ac4a2
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -7,6 +7,8 @@ import static org.bytedeco.javacpp.avutil.AV_PIX_FMT_RGB0;
import static org.bytedeco.javacpp.avutil.AV_PIX_FMT_YUV420P;
import java.awt.AWTException;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Executor;
......@@ -114,6 +116,7 @@ public class FfmpegScreenshare {
mainRecorder.start();
} catch (Exception e) {
System.out.println("Exception starting recorder. \n" + e.toString());
System.out.println(printStacktrace(e));
listener.networkConnectionException(ExitCode.INTERNAL_ERROR, null);
}
}
......@@ -166,6 +169,7 @@ public class FfmpegScreenshare {
}
} catch (Exception e1) {
System.out.println("Exception grabbing image");
System.out.println(printStacktrace(e1));
listener.networkConnectionException(ExitCode.INTERNAL_ERROR, null);
}
......@@ -476,6 +480,17 @@ private FFmpegFrameRecorder setupMacOsXRecorder(String url, int width, int heig
macGrabber.setOption("capture_mouse_clicks", "1");
return macGrabber;
}
private String printStacktrace(Exception exception) {
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
exception.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
return stackTrace;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment