Skip to content

Commit 6688c0f

Browse files
committed
Fix: suppress errors where config lookup fails
1 parent e0b73a3 commit 6688c0f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/lib/error.cfc

+7-1
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@
3131
<cffunction name="logToRaygun" access="public" output="false" returntype="void" hint="Logs data to the couchdb">
3232
<cfargument name="type" type="string" required="true" hint="Log type" />
3333
<cfargument name="data" type="struct" requried="true" hint="A normalized error struct as produced by the core error library" />
34+
35+
<cftry>
36+
<cfset var apiKey = application.fapi.getConfig("raygun", "apiKey", "") />
37+
<cfcatch>
38+
<cfset var apiKey = "" />
39+
</cfcatch>
40+
</cftry>
3441

35-
<cfset var apiKey = application.fapi.getConfig("raygun", "apiKey", "") />
3642

3743
<cfif len(apiKey)>
3844
<cfthread action="run" name="log-error-#createuuid()#" data="#arguments.data#" apiKey="#apiKey#" headers="#getHttpRequestData().headers#">

0 commit comments

Comments
 (0)