File attachment - out of disk space error - how to handle?


We are on DAX 2012 CU3. Our file attachment DAX custom service can’t attach the files when the disk ran out of the space on the server. I am wondering is there a way to handle the error that returns when the server ran out of disk space or something like ERROR_DISK_FULL?

When I am trying to put the code the for exception handling I only see the below error handling options available. Any inputs how it can be handled?




It’s a tricky topic. But before going into details, consider if you really need to know whether there is no disk space or it failed for another reason (e.g. a HW failure or a read-only location). If you react in the same way, investing time to distinguishing them wouldn’t make much sense. Shouldn’t you rather start monitoring disk space on your servers to avoid the problem in the first place?

X++ exception don’t contain any additional metadata, you just get a value of that enum (= a number) and that’s it. All you can do is looking at the last message in infolog.

You can achieve more with .NET exceptions, but in this case you’ll get just a generic IOException. If you want to find the particular reason such as ERROR_DISK_FULL, you would have to dig into its HResults, which is a bit tricky in .NET framework lower than 4.5 (but doable).

Maybe it’s possible to get HResults even for errors from AX kernel, but I’ve never tried it.