Dont-Reassign-Caught-Exceptions
Documentation Index
Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
Use this file to discover all available pages before exploring further.
Sourcery rule id: dont-reassign-caught-exceptions
Section titled “Sourcery rule id: dont-reassign-caught-exceptions”Description
Section titled “Description”Don’t reassign the bound exception ${exc}
try { whatever(); } catch (e) { e = new Error('something'); }Explanation
Section titled “Explanation”Reassigning exceptions may lead to unexpected behaviour, and the variable should be treated as if it were constant.