Incidents
  • 25 Mar 2024
  • 1 Minute to read
  • Contributors
  • PDF

Incidents

  • PDF

Article summary

Reporting Incidents

Reporting Incidents is pretty trivial in custom nodes. Just call nodeBase.reportIncident method with an incident level and your incident message.

	nodeBase.reportIncident(IncidentLevel.Warning, "some Incident message");

In custom nodes you have access to the following Incident levels:

const IncidentLevel = {
	Debug: "Debug", 
	Warning: "Warning", 	
	Error: "Error" 
};
  • Error: There is an error which prevents proper operation.
  • Warning: There seems to be a problem, but it may or may not cause operation to fail.
  • Debug: Provides useful information to client. May be useful for your debugging.

Reading the Incidents

Reading the incidents is easy for clients. There are different ways to see incidents in HTTP requests and WebSocket connections.

WebSocket & Grpc

The incidents will be sent as json formatted text to the client in real time.

{
	"IncidentLevel": "Error" , 
	"Message" : "determine user failed http status code : 401 http status text : Unauthorized request ur1 : https://demo—notstable.web.ca.demo.sestek.com/ext—api/v1/determine—user?AgentName=nu11\u@026DeviceId=nu11\u0026Externa11d=cf179d9d—13e7—Uf7U—890c—13a request body : request userParameters: Externalld=cf179d9d-13e7-L1f7u-890c-13a0928b515f\u0026PbxAgent1d=utku. rtg", 
	"MessageName": "Incident" ,
	"Nodeld" : "CARealtime-10",
	"NodeName" : "CA Realtime" ,
	"Sessionld" : "006bd60991buL172e" 
}

HTTP

The HTTP Response body will contain both the Results and the Incidents.

image.png

Remarks

Incidents are unplanned things that occur while there is an active operation. So if there is no operation you cannot report incidents. Errors/exceptions that occur while starting a new operation are considered errors

happen during Runtime. So any incidents reported during the node initialization phase won't be reported.


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.