 			opt = JSON.parse(option)
 			return opt
 		catch err
-			console.error "problem parsing #{option}, invalid JSON"
-			return undefined
-
+			throw new Error("problem parsing #{option}, invalid JSON")
+
+parseIntOrFail = (value)->
+	parsedValue = parseInt(value, 10)
+	if isNaN(parsedValue)
+		throw new Error("'#{value}' is an invalid integer")
+	return parsedValue
 
 DATA_DIR = '/var/lib/sharelatex/data'
 TMP_DIR = '/var/lib/sharelatex/tmp'

			acceptedClockSkewMs: (
				if _saml_skew = process.env["SHARELATEX_SAML_ACCEPTED_CLOCK_SKEW_MS"]
					try
						parseInt(_saml_skew)
					catch e
						console.error "Cannot parse SHARELATEX_SAML_ACCEPTED_CLOCK_SKEW_MS"
				else

			connectTimeout: (
				if _ldap_connect_timeout = process.env["SHARELATEX_LDAP_CONNECT_TIMEOUT"]
					try
						parseIntOrFail(_ldap_connect_timeout)
					catch e
						console.error "Cannot parse SHARELATEX_LDAP_CONNECT_TIMEOUT"
				else
