Guest User

Untitled

a guest
Feb 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. try {
  2. // .... Additional code here
  3.  
  4. const typecheck = await Promise.all(
  5. evoCfg.cameras.map(async camera => {
  6. if (camera.type === 'H264') {
  7. return await matchCamera(camera);
  8. } else if (camera.type === 'RTSP') {
  9. return await matchIP(camera);
  10. } else if (camera.type === 'AUDIO') {
  11. return await matchAudio(camera);
  12. } else {
  13. // Motion JPEG
  14. return true;
  15. }
  16. })
  17. );
  18.  
  19. // .... additional code here
  20.  
  21. console.log('results:);
  22. console.dir(typecheck, {depth: null, colors: true});
  23. } catch (e) {
  24. console.error('In Master Catch:', e);
  25. }
  26.  
  27. results:
  28. [ true,
  29. true,
  30. true,
  31. true,
  32. true,
  33. true,
  34. Error: MAC for IP Cam not found on Network: 00:11:22:33:44:55
  35. at matchIP (/file.js:58:15)
  36. at process._tickCallback (internal/process/next_tick.js:68:7),
  37. true ]
  38.  
  39. In Master Catch: MAC for IP Cam not found on Network: 00:11:22:33:44:55
  40. at matchIP (/file.js:58:15)
  41. at process._tickCallback (internal/process/next_tick.js:68:7)
  42.  
  43. try {
  44. // .... Additional code here
  45.  
  46. const typecheck = await Promise.all(
  47. evoCfg.cameras.map(camera => {
  48. if (camera.type === 'H264') {
  49. return matchCamera(camera);
  50. } else if (camera.type === 'RTSP') {
  51. return matchIP(camera);
  52. } else if (camera.type === 'AUDIO') {
  53. return matchAudio(camera);
  54. } else {
  55. // Motion JPEG
  56. return true;
  57. }
  58. })
  59. );
  60.  
  61. // .... additional code here
  62.  
  63. console.log('results:);
  64. console.dir(typecheck, {depth: null, colors: true});
  65. } catch (e) {
  66. console.error('In Master Catch:', e);
  67. }
  68.  
  69. const typecheckArray = await Promise.all(
  70. evoCfg.cameras.map(camera => {
  71. if (camera.type === 'H264') {
  72. return matchCamera(camera);
  73. } else if (camera.type === 'RTSP') {
  74. return matchIP(camera);
  75. } else if (camera.type === 'AUDIO') {
  76. return matchAudio(camera);
  77. } else {
  78. // Motion JPEG
  79. return Promise.resolve(true);
  80. }
  81. })
  82. );
Add Comment
Please, Sign In to add comment