Add Feature Error Handling in QT

543
2
08-30-2018 04:24 PM
JackChan
New Contributor

Hi

 Is there anyway that we can captured the add feature error detail? For example when you add new feature outside the local GB extent, how do you get the error message? I only can get addFeatureStatus = 3 (that means error happened when add feature), but it does not give me more information. Is there any ways we can handle the error better?

Cheers

Jack

0 Kudos
2 Replies
LucasDanzinger
Esri Frequent Contributor

All objects in ArcGIS Runtime SDK for Qt inherit from the type Object - Object QML Type | ArcGIS for Developers 

This means a few things:

- they all have an errorChanged signal that emits whenever there is an error

- they all have an error property that returns an Error object. You can access this object whenever errorChanged emits, or in your case if a task fails.

For example:

if (addFeatureStatus === Enums.TaskStatusErrored) {
  console.log("error:", error.message, error.additionalMessage);
}
JackChan
New Contributor

Thank you. It helps a lot.

0 Kudos