-
Notifications
You must be signed in to change notification settings - Fork 166
Expand file tree
/
Copy pathErrors.ts
More file actions
114 lines (85 loc) · 6.02 KB
/
Errors.ts
File metadata and controls
114 lines (85 loc) · 6.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/**
* SPDX-License-Identifier: Apache-2.0
* Copyright FINOS FDC3 contributors - see NOTICE file
*/
/**
* Contains constants representing the errors that can be encountered when trying to connect to a web-based Desktop Agent with the getAgent function.
*/
export enum AgentError {
/** Returned if no Desktop Agent was found by any means available or
* if the Agent previously connected to is not contactable on a
* subsequent connection attempt.*/
AgentNotFound = 'AgentNotFound',
/** Returned if validation of the app identity by the Desktop Agent
* Failed or the app is not being allowed to connect to the Desktop Agent
* for another reason. */
AccessDenied = 'AccessDenied',
/** Returned if an error or exception occurs while trying to set
* up communication with a Desktop Agent. */
ErrorOnConnect = 'ErrorOnConnect',
/** Returned if the failover function is not a function, or it did not
* resolve to one of the allowed types. */
InvalidFailover = 'InvalidFailover',
}
/** Constants representing the errors that can be encountered when calling the `open` method on the DesktopAgent object (`fdc3`). */
export enum OpenError {
/** Returned if the specified application is not found.*/
AppNotFound = 'AppNotFound',
/** Returned if the specified application fails to launch correctly.*/
ErrorOnLaunch = 'ErrorOnLaunch',
/** Returned if the specified application launches but fails to add a context listener in order to receive the context passed to the `fdc3.open` call.*/
AppTimeout = 'AppTimeout',
/** Returned if the FDC3 desktop agent implementation is not currently able to handle the request.*/
ResolverUnavailable = 'ResolverUnavailable',
/** Returned if a call to the `open` function is made with an invalid context argument. Contexts should be Objects with at least a `type` field that has a `string` value.*/
MalformedContext = 'MalformedContext',
/** @experimental Returned if the specified Desktop Agent is not found, via a connected Desktop Agent Bridge.*/
DesktopAgentNotFound = 'DesktopAgentNotFound',
}
/** Constants representing the errors that can be encountered when calling the `findIntent`, `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the DesktopAgent (`fdc3`). */
export enum ResolveError {
/** SHOULD be returned if no apps are available that can resolve the intent and context combination.*/
NoAppsFound = 'NoAppsFound',
/** Returned if the FDC3 desktop agent implementation is not currently able to handle the request.*/
ResolverUnavailable = 'ResolverUnavailable',
/** Returned if the user cancelled the resolution request, for example by closing or cancelling a resolver UI.*/
UserCancelled = 'UserCancelledResolution',
/** SHOULD be returned if a timeout cancels an intent resolution that required user interaction. Please use `ResolverUnavailable` instead for situations where a resolver UI or similar fails.*/
ResolverTimeout = 'ResolverTimeout',
/** Returned if a specified target application is not available or a new instance of it cannot be opened. */
TargetAppUnavailable = 'TargetAppUnavailable',
/** Returned if a specified target application instance is not available, for example because it has been closed. */
TargetInstanceUnavailable = 'TargetInstanceUnavailable',
/** Returned if the intent and context could not be delivered to the selected application or instance, for example because it has not added an intent handler within a timeout.*/
IntentDeliveryFailed = 'IntentDeliveryFailed',
/** Returned if a call to one of the `raiseIntent` functions is made with an invalid context argument. Contexts should be Objects with at least a `type` field that has a `string` value.*/
MalformedContext = 'MalformedContext',
/** @experimental Returned if the specified Desktop Agent is not found, via a connected Desktop Agent Bridge.*/
DesktopAgentNotFound = 'DesktopAgentNotFound',
}
export enum ResultError {
/** Returned if the intent handler exited without returning a valid result (a promise resolving to a Context, Channel object or void). */
NoResultReturned = 'NoResultReturned',
/** Returned if the Intent handler function processing the raised intent throws an error or rejects the Promise it returned. */
IntentHandlerRejected = 'IntentHandlerRejected',
}
export enum ChannelError {
/** Returned if the specified channel is not found when attempting to join a channel via the `joinUserChannel` function of the DesktopAgent (`fdc3`).*/
NoChannelFound = 'NoChannelFound',
/** SHOULD be returned when a request to join a user channel or to a retrieve a Channel object via the `joinUserChannel` or `getOrCreateChannel` methods of the DesktopAgent (`fdc3`) object is denied. */
AccessDenied = 'AccessDenied',
/** SHOULD be returned when a channel cannot be created or retrieved via the `getOrCreateChannel` method of the DesktopAgent (`fdc3`).*/
CreationFailed = 'CreationFailed',
/** Returned if a call to the `broadcast` functions is made with an invalid context argument. Contexts should be Objects with at least a `type` field that has a `string` value.*/
MalformedContext = 'MalformedContext',
}
export enum BridgingError {
/** @experimental Returned if a Desktop Agent did not return a response, via Desktop Agent Bridging, within the alloted timeout. */
ResponseTimedOut = 'ResponseToBridgeTimedOut',
/** @experimental Returned if a Desktop Agent that has been targeted by a particular request has been disconnected from the Bridge before a response has been received from it. */
AgentDisconnected = 'AgentDisconnected',
/** @experimental Returned for FDC3 API calls that are specified with arguments indicating that a remote Desktop agent should be targeted (e.g. raiseIntent with an app on a remote DesktopAgent targeted), when the local Desktop Agent is not connected to a bridge. */
NotConnectedToBridge = 'NotConnectedToBridge',
/** @experimental Returned if a message to a Bridge deviates from the schema for that message sufficiently that it could not be processed. */
MalformedMessage = 'MalformedMessage',
}