#pragma once
#include <string_view>
#include "ezer/code.hpp"

/* 
 * This file as been generated through: https://github.com/andrei-c2512/cpp-error-generator
 * */

namespace ezer::mylib {
	constexpr std::string_view matrix[][3] = {
	{"Connection lost","Invalid socket descriptor",""},
	{"Cannot bind to port","Cannot listen on socket","Server timed out"}};

    std::string_view format(const code& ec){
        return matrix[ec.category_id][ec.error_id];
    }

	constexpr code SOC_ConnectionLost = { 0, 0, format };
	constexpr code SOC_InvalidDescriptor = { 0, 1, format };
	constexpr code SRV_BindFailure = { 1, 0, format };
	constexpr code SRV_ListenFailure = { 1, 1, format };
	constexpr code SRV_Timeout = { 1, 2, format }; 
}
