-
Notifications
You must be signed in to change notification settings - Fork 0
/
debugBehavior.ts
39 lines (32 loc) · 1.24 KB
/
debugBehavior.ts
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
import { EndpointDescription, EndpointBehavior } from "../description/endpointDescription";
import { DispatchEndpoint } from "../dispatcher/dispatchEndpoint";
import { ServiceDescription, ServiceBehavior } from "../description/serviceDescription";
import { DispatchService } from "../dispatcher/dispatchService";
/**
* Service and Endpoint Behavior that enabled debugging information to be sent to the client.
*
* <uml>
* hide members
* hide circle
* EndpointBehavior <|.. DebugBehavior
* ServiceBehavior <|.. DebugBehavior
* </uml>
*/
export class DebugBehavior implements EndpointBehavior, ServiceBehavior {
applyEndpointBehavior(description: EndpointDescription, endpoint: DispatchEndpoint): void {
this._enableDebugging(endpoint);
}
applyServiceBehavior(description: ServiceDescription, service: DispatchService): void {
for(var i = 0; i < service.endpoints.length; i++) {
this._enableDebugging(service.endpoints[i]);
}
}
/**
* Enables debugging information in error messages for an endpoint.
* @param endpoint The target endpoint.
* @hidden
*/
private _enableDebugging(endpoint: DispatchEndpoint): void {
endpoint.includeErrorDetailInFault = true;
}
}