Jim Priest
05/06/2025, 3:40 PMtry {
application.stats = FileRead("/etc/stats.json");
} catch (Any e) {
application.stats = StructNew();
}zackster
05/06/2025, 3:41 PMzackster
05/06/2025, 3:42 PMzackster
05/06/2025, 3:49 PMJim Priest
05/06/2025, 3:54 PMtype string expression
In CF I get type java.io.FileNotFoundExceptionzackster
05/06/2025, 3:55 PMzackster
05/06/2025, 3:58 PMzackster
05/06/2025, 4:11 PMJim Priest
05/06/2025, 5:00 PMJim Priest
05/06/2025, 7:47 PMdswitzer
05/06/2025, 9:19 PMdeserializeJSON() and it will now throw an exception if the input is an empty string.
My suspicion is the file is coming back empty, so it's not the fileRead() that's the problem (which would explain the expression exception.
However, it should certainly be catching both errors.
You might try splitting things up to see if you can determine if the problem is really with file reading or the deserializing.Jim Priest
05/06/2025, 9:26 PM