[Ils-source] r1535 - trunk/src/com/resolutions/ils/data

scribe at crosswire.org scribe at crosswire.org
Fri Apr 28 16:51:51 MST 2017


Author: scribe
Date: 2017-04-28 16:51:50 -0700 (Fri, 28 Apr 2017)
New Revision: 1535

Modified:
   trunk/src/com/resolutions/ils/data/CourseAttempt.java
Log:
Catch exception looking up saved course certs and continue if security error


Modified: trunk/src/com/resolutions/ils/data/CourseAttempt.java
===================================================================
--- trunk/src/com/resolutions/ils/data/CourseAttempt.java	2017-04-26 18:27:28 UTC (rev 1534)
+++ trunk/src/com/resolutions/ils/data/CourseAttempt.java	2017-04-28 23:51:50 UTC (rev 1535)
@@ -809,25 +809,25 @@
 		Properties sysConfig = Utils.getSysConfig(null, getCompanyID());
 		String certsFolder = sysConfig.getProperty("certsFolder", "certs");
 logger.debug("certsFolder: " + certsFolder);
-		File sysConfigPath = Utils.getSysConfigFile(null, getCompanyID());
-		File certs = new File(sysConfigPath.getParentFile().getParent(), certsFolder);
-logger.debug("certsFolderPath: " + certs.getAbsolutePath());
-		if (certs.exists()) {
-			String certName = String.format("%08d_%08d_%08d.pdf", getCourseAttemptUserProfileID(), getCourseAttemptCourseID(), getCourseAttemptID());
-			File cert = new File(certs, certName);
-logger.debug("certPath: " + cert.getAbsolutePath());
-			if (cert.exists()) {
-				try {
-logger.debug("Exists!");
-					byte[] certBytes = DataObject.getBytes(new FileInputStream(cert));
-logger.debug("certBytes: " + certBytes);
-					return certBytes;
+		try {
+			File sysConfigPath = Utils.getSysConfigFile(null, getCompanyID());
+			File certs = new File(sysConfigPath.getParentFile().getParent(), certsFolder);
+	logger.debug("certsFolderPath: " + certs.getAbsolutePath());
+			if (certs.exists()) {
+				String certName = String.format("%08d_%08d_%08d.pdf", getCourseAttemptUserProfileID(), getCourseAttemptCourseID(), getCourseAttemptID());
+				File cert = new File(certs, certName);
+	logger.debug("certPath: " + cert.getAbsolutePath());
+				if (cert.exists()) {
+	logger.debug("Exists!");
+						byte[] certBytes = DataObject.getBytes(new FileInputStream(cert));
+	logger.debug("certBytes: " + certBytes);
+						return certBytes;
 				}
-				catch (Exception e) {
-logger.debug(e);
-				}
 			}
 		}
+		catch (Exception e) {
+			logger.error(e, e);
+		}
 		return null;
 	}
 




More information about the Ils-source mailing list