Skip to content

Commit

Permalink
Using the new ErrorDetail
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Jan 13, 2022
1 parent 3fd24ed commit af09806
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions FetchXmlBuilder/FetchXmlBuilder.cs
Expand Up @@ -771,7 +771,7 @@ internal void LoadViews(Action viewsLoaded)
EnableControls(true);
if (completedargs.Error != null)
{
MessageBox.Show(completedargs.Error.Message);
ErrorDetail.ShowDialog(this, completedargs.Error);
}
else
{
Expand Down Expand Up @@ -883,7 +883,7 @@ internal void QueryExpressionToFetchXml(string query)
{
if (completedargs.Error != null)
{
MessageBox.Show(completedargs.Error.Message, "Parse QueryExpression", MessageBoxButtons.OK, MessageBoxIcon.Error);
ErrorDetail.ShowDialog(this, completedargs.Error, "Parse QueryExpression");
}
else if (completedargs.Result is string)
{
Expand Down Expand Up @@ -1026,7 +1026,7 @@ private void ExecuteFetch(string fetch)
working = false;
if (completedargs.Error != null)
{
MessageBox.Show(completedargs.Error.Message);
ErrorDetail.ShowDialog(this, completedargs.Error);
}
else if (completedargs.Result is string)
{
Expand Down Expand Up @@ -1202,7 +1202,7 @@ private void LoadEntities()
{
if (completedargs.Error != null)
{
MessageBox.Show(completedargs.Error.Message);
ErrorDetail.ShowDialog(this, completedargs.Error, "Load Entities");
}
else
{
Expand Down Expand Up @@ -1556,10 +1556,7 @@ private void RetrieveMultiple(string fetch)
if (completedargs.Error != null)
{
LogError("RetrieveMultiple error: {0}", completedargs.Error);
if (MessageBox.Show(completedargs.Error.Message + "\n\nTry with result as ExecuteFetch?", "Execute", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK)
{
ExecuteFetch(fetch);
}
ErrorDetail.ShowDialog(this, completedargs.Error);
}
else if (completedargs.Cancelled)
{
Expand Down Expand Up @@ -1764,7 +1761,7 @@ private void SaveML()
{
if (completedargs.Error != null)
{
MessageBox.Show(completedargs.Error.Message, "Save Marketing List", MessageBoxButtons.OK, MessageBoxIcon.Error);
ErrorDetail.ShowDialog(this, completedargs.Error, "Save Marketing List");
}
else
{
Expand Down Expand Up @@ -1868,7 +1865,7 @@ private void SaveView(bool saveas)
{
if (completedargs.Error != null)
{
MessageBox.Show(completedargs.Error.Message, "Save view", MessageBoxButtons.OK, MessageBoxIcon.Error);
ErrorDetail.ShowDialog(this, completedargs.Error, "Save view");
}
else
{
Expand Down

0 comments on commit af09806

Please sign in to comment.