Skip to content

Commit c3fc529

Browse files
committed
Switched samples requires, updated error catching.
1 parent 663db28 commit c3fc529

9 files changed

+21
-18
lines changed

sample/README.MD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# TODO
2+
3+
Nothing to see here...

sample/change_password_operation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const LdapClientLib = require('../libs/ldap_async_wrap.js');
3+
const LdapClientLib = require('../index').Client;
44
const config = require('./config.json');
55

66
const newClient = new LdapClientLib(config.ldapAuthentication.host);
@@ -23,5 +23,5 @@ newClient.initialize()
2323
console.log('The user\'s password was changed with success');
2424
})
2525
.catch((err) => {
26-
console.log(`${err.name} ${err.constructor.description}`);
26+
console.log(err.toString());
2727
});

sample/compare_operation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const LdapClientLib = require('../libs/ldap_async_wrap.js');
3+
const LdapClientLib = require('../index').Client;
44

55
const config = require('./config.json');
66

@@ -31,5 +31,5 @@ newClient.initialize()
3131
console.log(`Compare result: ${result}`);
3232
})
3333
.catch((err) => {
34-
console.log(`${err.name} ${err.constructor.description}`);
34+
console.log(err.toString());
3535
});

sample/delete_operation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const LdapClientLib = require('../libs/ldap_async_wrap.js');
3+
const LdapClientLib = require('../index').Client;
44
const ldif = require('ldif');
55

66
const config = require('./config.json');
@@ -35,5 +35,5 @@ newClient.initialize()
3535
});
3636
})
3737
.catch((err) => {
38-
console.log(`${err.name} ${err.constructor.description}`);
38+
console.log(err.toString());
3939
});

sample/extended_operation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const LdapClientLib = require('../libs/ldap_async_wrap.js');
3+
const LdapClientLib = require('../index').Client;
44

55
const config = require('./config.json');
66

@@ -34,6 +34,6 @@ newClient.initialize()
3434
console.log(`The current user is: ${res}`);
3535
})
3636
.catch((err) => {
37-
console.log(`${err.name} ${err.constructor.description}`);
37+
console.log(err.toString());
3838
});
3939

sample/modify_operation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const LdapClientLib = require('../libs/ldap_async_wrap.js');
3+
const LdapClientLib = require('../index').Client;
44

55
const ldif = require('ldif');
66

@@ -48,5 +48,5 @@ newClient.initialize()
4848
});
4949
})
5050
.catch((err) => {
51-
console.log(`${err.name} ${err.constructor.description}`);
51+
console.log(err.toString());
5252
});

sample/page_search_operation.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const LdapClientLib = require('../libs/ldap_async_wrap.js');
3+
const LdapClientLib = require('../index').Client;
44

55
const ldif = require('ldif');
66

@@ -41,8 +41,8 @@ newClient.initialize()
4141
result.on('err', (err) => {
4242
console.log('-----------------');
4343
console.error(`Error name: ${err.name}`);
44-
console.error(`Error code: ${err.constructor.code}`);
45-
console.error(`Error description: ${err.constructor.description}`);
44+
console.error(`Error code: ${err.code}`);
45+
console.error(`Error description: ${err.description}`);
4646
console.log('-----------------');
4747
});
4848

@@ -51,5 +51,5 @@ newClient.initialize()
5151
});
5252
})
5353
.catch((err) => {
54-
console.log(`${err.name} ${err.constructor.description}`);
54+
console.log(err.toString());
5555
});

sample/rename_oparation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const LdapClientLib = require('../libs/ldap_async_wrap.js');
3+
const LdapClientLib = require('../index').Client;
44
const ldif = require('ldif');
55

66
const config = require('./config.json');
@@ -41,5 +41,5 @@ newClient.initialize()
4141
});
4242
})
4343
.catch((err) => {
44-
console.log(`${err.name} ${err.constructor.description}`);
44+
console.log(err.toString());
4545
});

sample/search_operation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const LdapClientLib = require('../libs/ldap_async_wrap.js');
3+
const LdapClientLib = require('../index').Client;
44

55
const ldif = require('ldif');
66

@@ -33,5 +33,5 @@ newClient.initialize()
3333
});
3434
})
3535
.catch((err) => {
36-
console.log(`${err.name} ${err.constructor.description}`);
36+
console.log(err.toString());
3737
});

0 commit comments

Comments
 (0)