Verified Commit 3c5c9e36 authored by Mateusz Żebrak's avatar Mateusz Żebrak
Browse files

Handle calculate_manabar_full_regeneration_time division by zero error

```
│ /home/mzebrak/1workspace/clive/clive/__private/core/iwax.py:80 in calculate_manabar_full_regeneration_time            │
│                                                                                                                       │
│   77 │   result = wax.calculate_manabar_full_regeneration_time(                                                       │
│   78 │   │   now=now, max_mana=max_mana, current_mana=current_mana, last_update_time=last_upd                         │
│   79 │   )                                                                                                            │
│ ❱ 80 │   __validate_wax_response(result)                                                                              │
│   81 │   return datetime.datetime.utcfromtimestamp(int(result.result.decode())).replace(tzinf                         │
│   82                                                                                                                  │
│   83                                                                                                                  │
│                                                                                                                       │
│ ╭───────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────╮ │
│ │     current_mana = 0                                                                                              │ │
│ │ last_update_time = 1630186584                                                                                     │ │
│ │         max_mana = 0                                                                                              │ │
│ │              now = 1694509788                                                                                     │ │
│ │           result = python_result(                                                                                 │ │
│ │                    │   status=<python_error_code.fail: 0>,                                                        │ │
│ │                    │   result=b'',                                                                                │ │
│ │                    │   exception_message=b'21 divide_by_zero_exception: Integer Divide By Zero\n\n                │ │
│ │                    {"a":"0","b":"0"}\n    s'+20                                                                   │ │
│ │                    )                                                                                              │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                       │
│ /home/mzebrak/1workspace/clive/clive/__private/core/iwax.py:22 in __validate_wax_response                             │
│                                                                                                                       │
│   19                                                                                                                  │
│   20 def __validate_wax_response(response: wax.python_result) -> None:                                                │
│   21 │   if response.status == wax.python_error_code.fail:                                                            │
│ ❱ 22 │   │   raise WaxOperationFailedError(response.exception_message.decode())                                       │
│   23                                                                                                                  │
│   24                                                                                                                  │
│   25 def __as_binary_json(item: Operation | Transaction) -> bytes:                                                    │
│                                                                                                                       │
│ ╭───────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────╮ │
│ │ response = python_result(                                                                                         │ │
│ │            │   status=<python_error_code.fail: 0>,                                                                │ │
│ │            │   result=b'',                                                                                        │ │
│ │            │   exception_message=b'21 divide_by_zero_exception: Integer Divide By Zero\n\n    {"a":"0","b":"0"}\n │ │
│ │            s'+20                                                                                                  │ │
│ │            )                                                                                                      │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
WaxOperationFailedError: 21 divide_by_zero_exception: Integer Divide By Zero

    {"a":"0","b":"0"}
    safe.hpp:82 operator/
```
parent 58e95e9e
Loading
Loading
Loading