Runtime class
Stay organized with collections
Save and categorize content based on your preferences.
Runtime provides methods to modify an extension instance's runtime data.
Signature:
export declare class Runtime
Methods
Runtime.setFatalError()
Reports a fatal error while running a lifecycle event handler.
Call this method when a lifecycle event handler fails in a way that makes the Instance inoperable. If the lifecycle event failed but the instance will still work as expected, call setProcessingState
with the "PROCESSING_WARNING" or "PROCESSING_FAILED" state instead.
Signature:
setFatalError(errorMessage: string): Promise<void>;
Parameters
Parameter |
Type |
Description |
errorMessage |
string |
A message explaining what went wrong and how to fix it. |
Returns:
Promise<void>
Runtime.setProcessingState()
Sets the processing state of an extension instance.
Use this method to report the results of a lifecycle event handler.
If the lifecycle event failed & the extension instance will no longer work correctly, use Runtime.setFatalError() instead.
To report the status of function calls other than lifecycle event handlers, use console.log
or the Cloud Functions logger SDK.
Signature:
setProcessingState(state: SettableProcessingState, detailMessage: string): Promise<void>;
Parameters
Parameter |
Type |
Description |
state |
SettableProcessingState |
The state to set the instance to. |
detailMessage |
string |
A message explaining the results of the lifecycle function. |
Returns:
Promise<void>
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-11-17 UTC.
[null,null,["Last updated 2022-11-17 UTC."],[],[],null,["# Runtime class\n\nRuntime provides methods to modify an extension instance's runtime data.\n\n**Signature:** \n\n export declare class Runtime \n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|--------------------------------------------------------------------------------------------------------------|-----------|----------------------------------------------------------------|\n| [setFatalError(errorMessage)](./firebase-admin.extensions.runtime.md#runtimesetfatalerror) | | Reports a fatal error while running a lifecycle event handler. |\n| [setProcessingState(state, detailMessage)](./firebase-admin.extensions.runtime.md#runtimesetprocessingstate) | | Sets the processing state of an extension instance. |\n\nRuntime.setFatalError()\n-----------------------\n\nReports a fatal error while running a lifecycle event handler.\n\nCall this method when a lifecycle event handler fails in a way that makes the Instance inoperable. If the lifecycle event failed but the instance will still work as expected, call `setProcessingState` with the \"PROCESSING_WARNING\" or \"PROCESSING_FAILED\" state instead.\n\n**Signature:** \n\n setFatalError(errorMessage: string): Promise\u003cvoid\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|--------------|--------|---------------------------------------------------------|\n| errorMessage | string | A message explaining what went wrong and how to fix it. |\n\n**Returns:**\n\nPromise\\\u003cvoid\\\u003e\n\nRuntime.setProcessingState()\n----------------------------\n\nSets the processing state of an extension instance.\n\nUse this method to report the results of a lifecycle event handler.\n\nIf the lifecycle event failed \\& the extension instance will no longer work correctly, use [Runtime.setFatalError()](./firebase-admin.extensions.runtime.md#runtimesetfatalerror) instead.\n\nTo report the status of function calls other than lifecycle event handlers, use `console.log` or the Cloud Functions logger SDK.\n\n**Signature:** \n\n setProcessingState(state: SettableProcessingState, detailMessage: string): Promise\u003cvoid\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|---------------|-----------------------------------------------------------------------------------|-------------------------------------------------------------|\n| state | [SettableProcessingState](./firebase-admin.extensions.md#settableprocessingstate) | The state to set the instance to. |\n| detailMessage | string | A message explaining the results of the lifecycle function. |\n\n**Returns:**\n\nPromise\\\u003cvoid\\\u003e"]]