\hypertarget{group__Eina__Error__Group}{\section{Error}
\label{group__Eina__Error__Group}\index{Error@{Error}}
}


This group discusses the functions that provide error management for projects.  


\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{typedef int \hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error}}\label{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}

\begin{DoxyCompactList}\small\item\em The integer type containing the error type. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error} \hyperlink{group__Eina__Error__Group_gacd6991f1ce57f853ddb19f32bb4aad38}{eina\+\_\+error\+\_\+msg\+\_\+register} (const char $\ast$msg) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1) \hyperlink{group__Eina__Types__Group_ga4ba89e4b58eff707a6cf05ffe0cd4dea}{E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T}
\begin{DoxyCompactList}\small\item\em Registers a new error type. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error} \hyperlink{group__Eina__Error__Group_ga004c7ceb7103cd5a698247ae3eb4578a}{eina\+\_\+error\+\_\+msg\+\_\+static\+\_\+register} (const char $\ast$msg) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1) \hyperlink{group__Eina__Types__Group_ga4ba89e4b58eff707a6cf05ffe0cd4dea}{E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T}
\begin{DoxyCompactList}\small\item\em Registers a new error type, statically allocated message. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Eina__Error__Group_ga79082e98c20137de7603f5697d581321}{eina\+\_\+error\+\_\+msg\+\_\+modify} (\hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error} error, const char $\ast$msg) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(2)
\begin{DoxyCompactList}\small\item\em Changes the message of an already registered message. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error} \hyperlink{group__Eina__Error__Group_gae0683831c4f8eebfdcb4f3cf1aef7052}{eina\+\_\+error\+\_\+get} (void)
\begin{DoxyCompactList}\small\item\em Returns the last set error. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void \hyperlink{group__Eina__Error__Group_ga80a8249f135460d4e07ebfe3f0a7bad1}{eina\+\_\+error\+\_\+set} (\hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error} err)
\begin{DoxyCompactList}\small\item\em Sets the last error. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} const char $\ast$ \hyperlink{group__Eina__Error__Group_ga3402bc58a9f854391eb35fa7650edda5}{eina\+\_\+error\+\_\+msg\+\_\+get} (\hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error} error) \hyperlink{group__Eina__Types__Group_ga4669a55a23089d0f9b70702ef05cea68}{E\+I\+N\+A\+\_\+\+P\+U\+R\+E}
\begin{DoxyCompactList}\small\item\em Returns the description of the given error number. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error} \hyperlink{group__Eina__Error__Group_gaa1fe233ecb39f5f00bdd1f1a6f3c5a83}{eina\+\_\+error\+\_\+find} (const char $\ast$msg) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1) \hyperlink{group__Eina__Types__Group_ga4669a55a23089d0f9b70702ef05cea68}{E\+I\+N\+A\+\_\+\+P\+U\+R\+E}
\begin{DoxyCompactList}\small\item\em Finds the \hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error} corresponding to a message string. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group__Eina__Error__Group_gad5e9a56fa33593d588df95bf6413964a}{\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error} \hyperlink{group__Eina__Error__Group_gad5e9a56fa33593d588df95bf6413964a}{E\+I\+N\+A\+\_\+\+E\+R\+R\+O\+R\+\_\+\+O\+U\+T\+\_\+\+O\+F\+\_\+\+M\+E\+M\+O\+R\+Y}}\label{group__Eina__Error__Group_gad5e9a56fa33593d588df95bf6413964a}

\begin{DoxyCompactList}\small\item\em The error identifier corresponding to lack of memory. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This group discusses the functions that provide error management for projects. 

The Eina error module provides a way to manage errors in a simple but powerful way in libraries and modules. It is also used in Eina itself. Similar to lib\+C's {\ttfamily errno} and strerror() facilities, this is extensible and recommended for other libraries and applications as well.

A simple example of how to use this can be seen \hyperlink{tutorial_error_page}{here}. 

\subsection{Function Documentation}
\hypertarget{group__Eina__Error__Group_gacd6991f1ce57f853ddb19f32bb4aad38}{\index{Error@{Error}!eina\+\_\+error\+\_\+msg\+\_\+register@{eina\+\_\+error\+\_\+msg\+\_\+register}}
\index{eina\+\_\+error\+\_\+msg\+\_\+register@{eina\+\_\+error\+\_\+msg\+\_\+register}!Error@{Error}}
\subsubsection[{eina\+\_\+error\+\_\+msg\+\_\+register}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Error} eina\+\_\+error\+\_\+msg\+\_\+register (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{msg}
\end{DoxyParamCaption}
)}}\label{group__Eina__Error__Group_gacd6991f1ce57f853ddb19f32bb4aad38}


Registers a new error type. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em msg} & The description of the error ~\newline
 It is duplicated using \hyperlink{group__Eina__Stringshare__Group_gac7a3f073cafb7af63b2c7cc2eabd1c1f}{eina\+\_\+stringshare\+\_\+add()}. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The unique number identifier for this error
\end{DoxyReturn}
This function stores the error message described by {\ttfamily msg} in a list. The returned value is a unique identifier greater than or equal to {\ttfamily 1}. The description can be retrieved later by passing the returned value to \hyperlink{group__Eina__Error__Group_ga3402bc58a9f854391eb35fa7650edda5}{eina\+\_\+error\+\_\+msg\+\_\+get()}.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Eina__Error__Group_ga004c7ceb7103cd5a698247ae3eb4578a}{eina\+\_\+error\+\_\+msg\+\_\+static\+\_\+register()} 
\end{DoxySeeAlso}


References eina\+\_\+stringshare\+\_\+add(), and E\+I\+N\+A\+\_\+\+T\+R\+U\+E.

\hypertarget{group__Eina__Error__Group_ga004c7ceb7103cd5a698247ae3eb4578a}{\index{Error@{Error}!eina\+\_\+error\+\_\+msg\+\_\+static\+\_\+register@{eina\+\_\+error\+\_\+msg\+\_\+static\+\_\+register}}
\index{eina\+\_\+error\+\_\+msg\+\_\+static\+\_\+register@{eina\+\_\+error\+\_\+msg\+\_\+static\+\_\+register}!Error@{Error}}
\subsubsection[{eina\+\_\+error\+\_\+msg\+\_\+static\+\_\+register}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Error} eina\+\_\+error\+\_\+msg\+\_\+static\+\_\+register (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{msg}
\end{DoxyParamCaption}
)}}\label{group__Eina__Error__Group_ga004c7ceb7103cd5a698247ae3eb4578a}


Registers a new error type, statically allocated message. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em msg} & The description of the error ~\newline
 This string is not duplicated and thus the given pointer should live during the usage of eina\+\_\+error. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The unique number identifier for this error
\end{DoxyReturn}
This function stores the error message described by {\ttfamily msg} in a list. The returned value is a unique identifier greater than or equal to {\ttfamily 1}. The description can be retrieved later by passing the returned value to \hyperlink{group__Eina__Error__Group_ga3402bc58a9f854391eb35fa7650edda5}{eina\+\_\+error\+\_\+msg\+\_\+get()}.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Eina__Error__Group_gacd6991f1ce57f853ddb19f32bb4aad38}{eina\+\_\+error\+\_\+msg\+\_\+register()} 
\end{DoxySeeAlso}


References E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E.



Referenced by efl\+::eina\+::unknown\+\_\+error().

\hypertarget{group__Eina__Error__Group_ga79082e98c20137de7603f5697d581321}{\index{Error@{Error}!eina\+\_\+error\+\_\+msg\+\_\+modify@{eina\+\_\+error\+\_\+msg\+\_\+modify}}
\index{eina\+\_\+error\+\_\+msg\+\_\+modify@{eina\+\_\+error\+\_\+msg\+\_\+modify}!Error@{Error}}
\subsubsection[{eina\+\_\+error\+\_\+msg\+\_\+modify}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Bool} eina\+\_\+error\+\_\+msg\+\_\+modify (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Error}}]{error, }
\item[{const char $\ast$}]{msg}
\end{DoxyParamCaption}
)}}\label{group__Eina__Error__Group_ga79082e98c20137de7603f5697d581321}


Changes the message of an already registered message. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em error} & The Eina\+\_\+\+Error to change the message of \\
\hline
\mbox{\tt in}  & {\em msg} & The description of the error ~\newline
 This string is duplicated only if the error is registered with \hyperlink{group__Eina__Error__Group_gacd6991f1ce57f853ddb19f32bb4aad38}{eina\+\_\+error\+\_\+msg\+\_\+register}, otherwise it must remain intact for the duration. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{E\+I\+N\+A\+\_\+\+T\+R\+U\+E} if successful, otherwise \hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E} on error
\end{DoxyReturn}
This function modifies the message associated with {\ttfamily error} and changes it to {\ttfamily msg}. If the error is previously registered by \hyperlink{group__Eina__Error__Group_ga004c7ceb7103cd5a698247ae3eb4578a}{eina\+\_\+error\+\_\+msg\+\_\+static\+\_\+register} then the string is not duplicated, otherwise the previous message is unrefed and {\ttfamily msg} is copied.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Eina__Error__Group_gacd6991f1ce57f853ddb19f32bb4aad38}{eina\+\_\+error\+\_\+msg\+\_\+register()} 
\end{DoxySeeAlso}


References E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E, eina\+\_\+stringshare\+\_\+add(), eina\+\_\+stringshare\+\_\+del(), and E\+I\+N\+A\+\_\+\+T\+R\+U\+E.

\hypertarget{group__Eina__Error__Group_gae0683831c4f8eebfdcb4f3cf1aef7052}{\index{Error@{Error}!eina\+\_\+error\+\_\+get@{eina\+\_\+error\+\_\+get}}
\index{eina\+\_\+error\+\_\+get@{eina\+\_\+error\+\_\+get}!Error@{Error}}
\subsubsection[{eina\+\_\+error\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Error} eina\+\_\+error\+\_\+get (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__Eina__Error__Group_gae0683831c4f8eebfdcb4f3cf1aef7052}


Returns the last set error. 

\begin{DoxyReturn}{Returns}
The last error
\end{DoxyReturn}
This function returns the last error set by \hyperlink{group__Eina__Error__Group_ga80a8249f135460d4e07ebfe3f0a7bad1}{eina\+\_\+error\+\_\+set()}. The description of the message is returned by \hyperlink{group__Eina__Error__Group_ga3402bc58a9f854391eb35fa7650edda5}{eina\+\_\+error\+\_\+msg\+\_\+get()}.

\begin{DoxyNote}{Note}
This function is thread safe 
\end{DoxyNote}
\begin{DoxySince}{Since}
1.\+10, but slower to use. 
\end{DoxySince}


References eina\+\_\+main\+\_\+loop\+\_\+is(), and eina\+\_\+tls\+\_\+get().



Referenced by efl\+::eina\+::get\+\_\+error\+\_\+code(), efl\+::eina\+::get\+\_\+error\+\_\+code\+\_\+enum(), and efl\+::eina\+::get\+\_\+error\+\_\+condition().

\hypertarget{group__Eina__Error__Group_ga80a8249f135460d4e07ebfe3f0a7bad1}{\index{Error@{Error}!eina\+\_\+error\+\_\+set@{eina\+\_\+error\+\_\+set}}
\index{eina\+\_\+error\+\_\+set@{eina\+\_\+error\+\_\+set}!Error@{Error}}
\subsubsection[{eina\+\_\+error\+\_\+set}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void eina\+\_\+error\+\_\+set (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Error}}]{err}
\end{DoxyParamCaption}
)}}\label{group__Eina__Error__Group_ga80a8249f135460d4e07ebfe3f0a7bad1}


Sets the last error. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em err} & The error identifier\\
\hline
\end{DoxyParams}
This function sets the last error identifier. The last error can be retrieved by \hyperlink{group__Eina__Error__Group_gae0683831c4f8eebfdcb4f3cf1aef7052}{eina\+\_\+error\+\_\+get()}.

\begin{DoxyNote}{Note}
This is also used to clear previous errors, in which case {\ttfamily err} should be {\ttfamily 0}.

This function is thread safe 
\end{DoxyNote}
\begin{DoxySince}{Since}
1.\+10, but slower to use. 
\end{DoxySince}


References eina\+\_\+main\+\_\+loop\+\_\+is(), and eina\+\_\+tls\+\_\+set().



Referenced by edje\+\_\+edit\+\_\+state\+\_\+image\+\_\+border\+\_\+fill\+\_\+set(), edje\+\_\+edit\+\_\+state\+\_\+image\+\_\+border\+\_\+set(), edje\+\_\+edit\+\_\+state\+\_\+image\+\_\+set(), efl\+::eina\+::get\+\_\+error\+\_\+code(), efl\+::eina\+::get\+\_\+error\+\_\+condition(), and efl\+::eina\+::set\+\_\+error\+\_\+code().

\hypertarget{group__Eina__Error__Group_ga3402bc58a9f854391eb35fa7650edda5}{\index{Error@{Error}!eina\+\_\+error\+\_\+msg\+\_\+get@{eina\+\_\+error\+\_\+msg\+\_\+get}}
\index{eina\+\_\+error\+\_\+msg\+\_\+get@{eina\+\_\+error\+\_\+msg\+\_\+get}!Error@{Error}}
\subsubsection[{eina\+\_\+error\+\_\+msg\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} const char$\ast$ eina\+\_\+error\+\_\+msg\+\_\+get (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Error}}]{error}
\end{DoxyParamCaption}
)}}\label{group__Eina__Error__Group_ga3402bc58a9f854391eb35fa7650edda5}


Returns the description of the given error number. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em error} & The error number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The description of the error
\end{DoxyReturn}
This function returns the description of an error that has been registered by \hyperlink{group__Eina__Error__Group_gacd6991f1ce57f853ddb19f32bb4aad38}{eina\+\_\+error\+\_\+msg\+\_\+register()}. If an incorrect error is given, then {\ttfamily N\+U\+L\+L} is returned. 

Referenced by efl\+::eina\+::error\+\_\+category\+::message().

\hypertarget{group__Eina__Error__Group_gaa1fe233ecb39f5f00bdd1f1a6f3c5a83}{\index{Error@{Error}!eina\+\_\+error\+\_\+find@{eina\+\_\+error\+\_\+find}}
\index{eina\+\_\+error\+\_\+find@{eina\+\_\+error\+\_\+find}!Error@{Error}}
\subsubsection[{eina\+\_\+error\+\_\+find}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Error} eina\+\_\+error\+\_\+find (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{msg}
\end{DoxyParamCaption}
)}}\label{group__Eina__Error__Group_gaa1fe233ecb39f5f00bdd1f1a6f3c5a83}


Finds the \hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error} corresponding to a message string. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em msg} & The error message string to match (N\+O\+T {\ttfamily N\+U\+L\+L}) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The \hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error} matching {\ttfamily msg}, otherwise {\ttfamily 0} on failure
\end{DoxyReturn}
This function attempts to match {\ttfamily msg} with its corresponding \hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error} value. If no such value is found, {\ttfamily 0} is returned. 