0

So basically I had the problem with circular dependency ---> how to resolve circular dependency

Application A-> Application B. If problem in B, threw an exception which is caught in A, and if the ex.message="error in B", then re-run the function in program A again.

Problem being now I want to throw a special exception. So when it returns to A

try
{
x = (List<POSUnitRecord>)GalwayPortal.Download_POS(url, null, new XmlResultInterpreter());
}
catch (XMLFailureException)
{
x = (List<POSUnitRecord>)GalwayPortal.Download_POS(url, null, new XmlResultInterpreter());
}

But the 'XMLFailureExeption.cs' is in application A. SO I tried adding this class to B. then throwing the throw new XMLFailureException(); error but it just returns to a normal exception in A, where it should be catching this and rerunning the function? Please advise?

Community
  • 1
  • 1
John
  • 3,965
  • 21
  • 77
  • 163

1 Answers1

2

Move XMLFailureException into a class library that is referenced by both A and B.

spender
  • 117,338
  • 33
  • 229
  • 351