mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
CE-881 - Updated what gets caught for file-not-found (presumably an updated apache dep due to POI changed this...)
This commit is contained in:
@ -26,6 +26,7 @@ import java.io.File;
|
|||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.nio.file.NoSuchFileException;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import com.kingsrook.qqq.backend.core.logging.QLogger;
|
import com.kingsrook.qqq.backend.core.logging.QLogger;
|
||||||
import com.kingsrook.qqq.backend.core.utils.JsonUtils;
|
import com.kingsrook.qqq.backend.core.utils.JsonUtils;
|
||||||
@ -98,14 +99,14 @@ public class TempFileStateProvider implements StateProviderInterface
|
|||||||
String json = FileUtils.readFileToString(getFile(key));
|
String json = FileUtils.readFileToString(getFile(key));
|
||||||
return (Optional.of(JsonUtils.toObject(json, type)));
|
return (Optional.of(JsonUtils.toObject(json, type)));
|
||||||
}
|
}
|
||||||
catch(FileNotFoundException fnfe)
|
catch(FileNotFoundException | NoSuchFileException fnfe)
|
||||||
{
|
{
|
||||||
return (Optional.empty());
|
return (Optional.empty());
|
||||||
}
|
}
|
||||||
catch(IOException e)
|
catch(IOException e)
|
||||||
{
|
{
|
||||||
LOG.error("Error getting state from file", e);
|
LOG.error("Error getting state from file", e);
|
||||||
throw (new RuntimeException("Error retreiving state", e));
|
throw (new RuntimeException("Error retrieving state", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user