Error handling#
Common way to catch errors from MetaApi is listening to the processingError
event.
The event will be emitted by MetaApi server in case of API error.
Error scheme: WebSocketError.
ValidationError
#
The ValidationError
error means error of incoming data in the request. Check the validity of the request data or read the error message, where it is indicated exactly where the error.
NotFoundError
#
The NotFoundError
error means that the requested resource was not found. Probably the resource id that you are requesting is incorrect.
NotSynchronizedError
#
The NotSynchronizedError
error code means that the requested data has not yet been synchronized with the terminal. Try to make a request after a while, so that the data has time to synchronize.
If your application uses streaming API, then make sure that synchronization was indeed started. See Synchronize request for more information.
NotAuthenticatedError
#
A NotAuthenticatedError
error occurs when synchronize is requested before the terminal has been connected to the application. Wait for the synchronization
event with the authenticated
type to appear and try again.
TradeError
#
This error means that a trading error has occurred on the server. Fix the error reason and retry the trade. More information about error can be retrieved from numericCode and stringCode fields (see www.mql5.com and book.mql4.com for full list of possible error codes).
InternalError
#
This error means that an unexpected error has occurred on the server. Retry the request later or contact support.