mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-01 04:29:35 -05:00
Provide human-readable syntax errors.
This commit is contained in:
parent
c445cb5546
commit
676558aa64
1 changed files with 21 additions and 0 deletions
|
|
@ -1240,4 +1240,25 @@ ldap_str2objectclass( char * s, int * code, char ** errp )
|
|||
}
|
||||
}
|
||||
|
||||
static char *err2text[] = {
|
||||
"",
|
||||
"Out of memory",
|
||||
"Unexpected token",
|
||||
"Missing opening parenthesis",
|
||||
"Missing closing parenthesis",
|
||||
"Expecting digit",
|
||||
"Expecting a name",
|
||||
"Bad description",
|
||||
"Bad superiors",
|
||||
"Duplicate option"
|
||||
};
|
||||
|
||||
char *
|
||||
ldap_scherr2str(int code)
|
||||
{
|
||||
if ( code < 1 || code >= (sizeof(err2text)/sizeof(char *)) ) {
|
||||
return "Unknown error";
|
||||
} else {
|
||||
return err2text[code];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue