diff --git a/examples/nodejs/cache/doc-example-files/config-and-error-handling.ts b/examples/nodejs/cache/doc-example-files/config-and-error-handling.ts index 3b1c5e683..71de75718 100644 --- a/examples/nodejs/cache/doc-example-files/config-and-error-handling.ts +++ b/examples/nodejs/cache/doc-example-files/config-and-error-handling.ts @@ -54,10 +54,10 @@ async function example_configuration_ConstructWithThrowOnErrorsConfig() { async function example_configuration_ErrorHandlingExceptionErrorCode(cacheClient: CacheClient) { try { - const result = await cacheClient.get('test-cache', 'test-key'); - if (result instanceof CacheGet.Hit) { - console.log(`Retrieved value for key 'test-key': ${result.valueString()}`); - } else if (result instanceof CacheGet.Miss) { + const result = (await cacheClient.get('test-cache', 'test-key')).value(); + if (result !== undefined) { + console.log(`Retrieved value for key 'test-key': ${result}`); + } else { console.log("Key 'test-key' was not found in cache 'test-cache'"); } } catch (e) {