Skip to content

Defined in header <fkYAML/exception.hpp>

fkyaml::exception::what

const char* what() const noexcept;

Returns an error message for an exception. If nothing, a non-null, empty string will be returned.

Example
#include <iostream>
#include <fkYAML/node.hpp>

int main() {
    try {
        throw fkyaml::exception("An error message.");
    }
    catch (const fkyaml::exception& e) {
        std::cout << e.what() << std::endl;
    }

    return 0;
}

output:

An error message.

See Also