Skip to content

Commit ac9ddb9

Browse files
committed
Merge branch 'develop'
# Conflicts: # adaptiveImages.cfc
2 parents c525b5c + 5db303f commit ac9ddb9

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.1.5 - 19 December 2019
2+
- \#9 Record the originally requested image URL when logging errors
3+
14
## 2.1.4 - 9 October 2019
25
- \#8 Replace GetFileInfo() with faster FileInfo() if using Lucee
36

adaptiveImages.cfc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
component{
22

3-
variables.version = "2.1.4";
3+
variables.version = "2.1.5";
44
variables.isACF = ( server.coldfusion.productname IS "ColdFusion Server" );
55
variables.isLucee = ( server.coldfusion.productname IS "Lucee" );
66

@@ -77,14 +77,20 @@ component{
7777
return sendImage( cachedFilePath, mimeType );
7878
}
7979
catch( any exception ){
80+
if( config.logErrors OR config.writeLogs ){
81+
var errorLogText = "AI Error";
82+
if( arguments.KeyExists( "originalUrl" ) )
83+
errorLogText &= " serving #arguments.originalUrl#";
84+
errorLogText &= ": ";
85+
}
8086
if( !DirectoryExists( cacheFolderPath ) OR !FileExists( cachedFilePath ) ){
8187
if( config.logErrors OR config.writeLogs )
82-
WriteLog( file: config.logFilename, text: "AI: Error Occured : cached image should exist according to FO cache but is missing. Clearing FO cache." );
88+
WriteLog( file: config.logFilename, text: errorLogText & "cached image should exist according to FO cache but is missing. Clearing FO cache." );
8389
clearFileOperationsCache();
8490
}
8591
else {
8692
if( config.logErrors OR config.writeLogs )
87-
WriteLog( file: config.logFilename, text: "AI: Error Occured : #exception.message#" );
93+
WriteLog( file: config.logFilename, text: errorLogText & exception.message );
8894
cfheader( statuscode: "503", statustext: "Temporary problem" );
8995
abort;
9096
}

0 commit comments

Comments
 (0)