# code without issues

# bare raise with alias - OK (preferred)
try:
    do()
except Exception as err:
    raise

# bare raise without alias - OK
try:
    do()
except Exception:
    raise

# bare raise with alias and condition - OK
try:
    do()
except Exception as err:
    if str(err) != "something":
        raise

# raise different exception - OK
try:
    do()
except Exception as err:
    raise ValueError("new error")

# raise with from - OK
try:
    do()
except Exception as err:
    raise ValueError("new error") from err

# bare raise outside except block - OK
def foo():
    raise

# raise different variable than caught alias - OK
try:
    do()
except Exception as err:
    other_err = ValueError("other")
    raise other_err

# code with issues

# raise err with alias - should use bare raise
try:
    do()
except Exception as err:
    raise err

# raise err with alias and condition
try:
    do()
except Exception as err:
    if str(err) != "something":
        raise err

# raise err with alias in tuple except
try:
    do()
except (ValueError, TypeError) as err:
    raise err

# nested try-except, inner raises inner alias
try:
    do()
except Exception as outer_err:
    try:
        do_more()
    except ValueError as inner_err:
        raise inner_err
