7
Reply

What is difference between the “throw” and “throw ex” in .NET?

Pradeep Yadav

Pradeep Yadav

May 24, 2017
513
1

    throw ex resets the stack trace (so your errors would appear to originate from HandleException) throw doesn't - the original offender would be preserved.

    Bharathi Raja
    January 20, 2018
    0

    throw ex resets the stack trace (so your errors would appear to originate from HandleException) throw doesn't - the original offender would be preserved.

    Bharathi Raja
    January 20, 2018
    0

    throw ex resets the stack trace (so your errors would appear to originate from HandleException) throw doesn't - the original offender would be preserved.

    Bharathi Raja
    January 20, 2018
    0

    throw ex resets the stack trace (so your errors would appear to originate from HandleException) throw doesn't - the original offender would be preserved.

    Bharathi Raja
    January 20, 2018
    0

    throw ex resets the stack trace (so your errors would appear to originate from HandleException) throw doesn't - the original offender would be preserved.

    Bharathi Raja
    January 20, 2018
    0

    Throw provide actual error Throw ex provide the stack trace

    Rajani Pandey
    January 07, 2018
    0

    “Throw” statement preserves original error stack whereas “throw ex” have the stack trace from their throw point. It is always advised to use “throw” because it provides more accurate error information.

    Pradeep Yadav
    May 24, 2017
    0