def METHOD_NAME(message):
    try:
        return simplejson.dumps(
            message.asdict(),
            default=encode_complex,
            ignore_nan=True,
            use_decimal=True,
        )
    except ValueError as err:
        raise Exception(f'Fail to serialize message {message}') from err