How to get the proper reason for Edit Operation Failed.. error.

176
3
2 weeks ago
TapasChakrabarty
New Contributor II

Hi,

I am trying to edit a Date field on the attribute table with some other data type. In this case, my EditOperation is getting failed which is correct. But when I try to capture the ErrorMessage of the EditOperation it shows me "Edit Operation Failed....". But I want a more specific error message as to why the Edit Operation failed. How can I get the specific reason for the Edit operation failed?

Below is my code snippet:

If Not (FieldValue = Nothing) Then
inspector(fieldName) = FieldValue.ToString()
Else
inspector(fieldName) = ""
End If

EditOp.Modify(inspector)
Dim result = EditOp.Execute()
If Not result Then
exception = EditOp.ErrorMessage()
End If

 

SDK 2.8, ArcGIS Pro 2.8, VS2019.

0 Kudos
3 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

I think the problem is caused when you assign a string data type to a date field.  Try to assign a DateTime type to date fields.  

0 Kudos
TapasChakrabarty
New Contributor II

Yes, you are right. I know the reason. But I want to display the error on UI so needed the particular reason why the edit operation failed. I am able to get the error message as "Edit Operation failed.". But I want to display Edit operation failed due to a data type mismatch.

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Unfortunately the underlying API doesn't return detailed error messages depending on the data source that is used for editing.  I will forward this post to the ArcGIS Pro's Dev Team to re-iterate that this is an issue.