From 679adc509ee228a4e68907f72ee6bfe5e98be4a9 Mon Sep 17 00:00:00 2001 From: benfry Date: Tue, 5 Dec 2006 13:05:29 +0000 Subject: [PATCH] error message fixes for two internal errors --- core/src/processing/core/PApplet.java | 9 +++++++++ video/src/processing/video/Capture.java | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index a94701d10..78d2854a4 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -3693,6 +3693,15 @@ public class PApplet extends Applet Float floatSize = new Float(size); if (lowerName.endsWith(".otf") || lowerName.endsWith(".ttf")) { + InputStream stream = openStream(name); + if (stream == null) { + System.err.println("The font \"" + name + "\" " + + "is missing or inaccessible, make sure " + + "the URL is valid or that the file has been " + + "added to your sketch and is readable."); + return null; + } + //font = Font.createFont(Font.TRUETYPE_FONT, openStream(name)); Method createFontMethod = Font.class.getMethod("createFont", diff --git a/video/src/processing/video/Capture.java b/video/src/processing/video/Capture.java index b9b205b2c..17e3e2fd5 100755 --- a/video/src/processing/video/Capture.java +++ b/video/src/processing/video/Capture.java @@ -507,11 +507,11 @@ public class Capture extends PImage implements Runnable { int errorCode = qte.errorCode(); if (errorCode == Errors.couldntGetRequiredComponent) { throw new RuntimeException("Couldn't find any capture devices, " + - "check the FAQ for more info."); + "read the video reference for more info."); } else { qte.printStackTrace(); throw new RuntimeException("Problem listing capture devices, " + - "check the FAQ for more info."); + "read the video reference for more info."); } } //return null;