How to use the rsp-client.StatusSeverity.isCancel function in rsp-client

To help you get started, we’ve selected a few rsp-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github redhat-developer / vscode-rsp-ui / src / extensionApi.ts View on Github external
private async handleWorkflow(response: Protocol.WorkflowResponse, workflowMap?: { [index: string]: any } ): Promise {
        if (StatusSeverity.isError(response.status)
                    || StatusSeverity.isCancel(response.status)) {
            // error
            return Promise.reject(response.status);
        }

        // not complete, not an error.
        if (!workflowMap) {
            workflowMap = {};
        }
        if (response.items) {
            for (const item of response.items) {
                const strategy: WorkflowResponseStrategy = new WorkflowResponseStrategyManager().getStrategy(item.itemType);
                const canceled: boolean = await strategy.handler(item, workflowMap);
                if (canceled) {
                    return;
                }
            }