@reldens/server-utils 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -90,9 +90,7 @@ class FileHandler
90
90
  let origin = Array.isArray(from) ? this.joinPaths(...from) : from;
91
91
  let dest = Array.isArray(to) ? this.joinPaths(...to) : to;
92
92
  if(!this.exists(origin)){
93
- return false;
94
- }
95
- if(!this.exists(dest)){
93
+ this.error = {message: 'Failed to copy file, origin does not exists.', from, to, origin, dest};
96
94
  return false;
97
95
  }
98
96
  try {
@@ -145,6 +143,7 @@ class FileHandler
145
143
  fs.rmSync(crudTestPath);
146
144
  return true;
147
145
  } catch (error) {
146
+ this.error = {message: 'Failed to check permissions.', error, systemPath};
148
147
  return false;
149
148
  }
150
149
  }
@@ -153,6 +152,7 @@ class FileHandler
153
152
  {
154
153
  let fileContents = this.fetchFileContents(filePath);
155
154
  if(!fileContents){
155
+ this.error = {message: 'Failed to fetch file contents.', filePath};
156
156
  return false;
157
157
  }
158
158
  let importedJson = JSON.parse(fileContents);
@@ -166,6 +166,7 @@ class FileHandler
166
166
  fetchFileContents(filePath)
167
167
  {
168
168
  if(!this.isFile(filePath)){
169
+ this.error = {message: 'File check failed to fetch file contents.', filePath};
169
170
  return false;
170
171
  }
171
172
  let fileContent = this.readFile(filePath);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reldens/server-utils",
3
3
  "scope": "@reldens",
4
- "version": "0.4.0",
4
+ "version": "0.6.0",
5
5
  "description": "Reldens - Server Utils",
6
6
  "author": "Damian A. Pastorini",
7
7
  "license": "MIT",