home.social

#parse — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #parse, aggregated by home.social.

  1. I'm trying to #parse a string into an int in an #esphome lambda. I can use std::stoi() and it works, but I'm struggling at error management. It raises an #exception if the string is not parseable (i.e. "text" instead of "2"), but ESPHome disables the exceptions, so I can't simply try-catch it...
    ATM the code is mostly working, but if the string isn't a valid int, the entire device crashes D:
    How am I supposed to implement this?
  2. I'm trying to #parse a string into an int in an #esphome lambda. I can use std::stoi() and it works, but I'm struggling at error management. It raises an #exception if the string is not parseable (i.e. "text" instead of "2"), but ESPHome disables the exceptions, so I can't simply try-catch it...
    ATM the code is mostly working, but if the string isn't a valid int, the entire device crashes D:
    How am I supposed to implement this?
  3. I'm trying to #parse a string into an int in an #esphome lambda. I can use std::stoi() and it works, but I'm struggling at error management. It raises an #exception if the string is not parseable (i.e. "text" instead of "2"), but ESPHome disables the exceptions, so I can't simply try-catch it...
    ATM the code is mostly working, but if the string isn't a valid int, the entire device crashes D:
    How am I supposed to implement this?
  4. I'm trying to #parse a string into an int in an #esphome lambda. I can use std::stoi() and it works, but I'm struggling at error management. It raises an #exception if the string is not parseable (i.e. "text" instead of "2"), but ESPHome disables the exceptions, so I can't simply try-catch it...
    ATM the code is mostly working, but if the string isn't a valid int, the entire device crashes D:
    How am I supposed to implement this?
  5. I'm trying to #parse a string into an int in an #esphome lambda. I can use std::stoi() and it works, but I'm struggling at error management. It raises an #exception if the string is not parseable (i.e. "text" instead of "2"), but ESPHome disables the exceptions, so I can't simply try-catch it...
    ATM the code is mostly working, but if the string isn't a valid int, the entire device crashes D:
    How am I supposed to implement this?