My function break rule 'DRY'. That's why I wanna make decorator to solve this problem. For example

```
def change_status(state: str) -> None:
    print(f"change {state} to pending")

    try:
        ...
        print(f"change{state} to success")
    except BaseException:
        print(f"change {state} to error")

```

As you can see that print() could call max and min 2 times. And I want to make decorator like

```
 def decorator():
        def wrapper(func):
            print(f"change{state} to pending")
            return func()
            .... # if try is success: print(f"change{state} to success")
            else:
                print(f"change {state} to error")
        return wrapper

```

I hope you can understand my question, also sorry for my English.