We often use try catch statements in our method, if the method can return a value, but the value doesn't a string, how to return the exception message? For example:
public int GetFile(string path) { int i; try { //... return i; } catch (Exception ex) { // How to return the ex? // If the return type is a custom class, how to deal with it? } } How to return the exception?