|
|
|
|
|
by bconway
5301 days ago
|
|
try treating the object as the first data type you expect, and catching the failure if that type wasn't that type, and then try the second. This allows users to create objects that are close enough to the types you expect and still use your code. Is chaining try-catches as a trial-and-error way to figure out a type really the Right Way to do things these days? |
|