summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-api.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-api.cpp')
-rw-r--r--source/slang/slang-api.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/source/slang/slang-api.cpp b/source/slang/slang-api.cpp
index a00d993e3..5ee384e4a 100644
--- a/source/slang/slang-api.cpp
+++ b/source/slang/slang-api.cpp
@@ -64,18 +64,15 @@ SlangResult trySaveStdLibToCache(
Slang::ComPtr<ISlangBlob> stdLibBlobPtr;
SLANG_RETURN_ON_FAIL(
globalSession->saveStdLib(SLANG_ARCHIVE_TYPE_RIFF_LZ4, stdLibBlobPtr.writeRef()));
- try
- {
- Slang::FileStream fileStream(cacheFilename, Slang::FileMode::Create);
- fileStream.write(&dllTimestamp, sizeof(dllTimestamp));
- fileStream.write(stdLibBlobPtr->getBufferPointer(), stdLibBlobPtr->getBufferSize());
- return SLANG_OK;
- }
- catch (...)
- {
- }
+
+ Slang::FileStream fileStream;
+ SLANG_RETURN_ON_FAIL(fileStream.init(cacheFilename, Slang::FileMode::Create));
+
+ SLANG_RETURN_ON_FAIL(fileStream.write(&dllTimestamp, sizeof(dllTimestamp)));
+ SLANG_RETURN_ON_FAIL(fileStream.write(stdLibBlobPtr->getBufferPointer(), stdLibBlobPtr->getBufferSize()))
}
- return SLANG_FAIL;
+
+ return SLANG_OK;
}
SLANG_API SlangResult slang_createGlobalSession(