hello, can someone advice if there's a list of exc...
# lucee
r
hello, can someone advice if there's a list of exceptions that could be raised by different tags? For example CFFILE can fail because mime type is not accepted, or extension is wrong, or there's no space left on disk, or no write permissions... It's hard to create tests for all cases, maybe there's list of possible errors, or else. Thanks
z
you can look at the source, but with the resource / file system layer abstractions in both Lucee and in java (i.e linux throws different errors than windows) it's complicated
g
I tried to look into; core/src/main/java/lucee/runtime/tag/FileTag.java To see if this was something I could look into as a Documentation task... To me; "looks" like it passes the underlying error messages from java - which "could" be different depending on the version of java you're running Lucee with. I.e. for Java 8 you can peruse through the source-code and look for all the exception types than be thrown; http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/java/io/File.java But "I" can't say for certain that what you get for every "Lucee" file operation is a "direct copy" from the underlying Java Runtime. Needless to say - it looks like a LOT of work. When I write tests - I start with the operations I have defined in code. Then I think about how can I break it? What happens if I put a number into a string field? A boolean? But I "temper" that against the rest of the code that I am using, too. Eg If I have a function that uses cffile. And MY function REQUIRES arguments A,B and C of type X,Y,Z - then I ONLY write tests that exercise using arguments A,B and C. of expected types and values - and unexpected types and values. I only ever do "more" if I get unexpected results. Hope this helps.