@oino-ts/common 1.0.2 → 1.0.4

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.
@@ -70,11 +70,11 @@ class OINOResult {
70
70
  if (this.statusText != "OK") {
71
71
  this.messages.push(this.statusText); // latest error becomes status, but if there was something non-trivial, add it to the messages
72
72
  }
73
- if (statusText.startsWith(OINOConstants_js_1.OINO_ERROR_PREFIX)) {
73
+ if (statusText && statusText.startsWith(OINOConstants_js_1.OINO_ERROR_PREFIX)) {
74
74
  this.statusText = statusText;
75
75
  }
76
76
  else {
77
- this.statusText = OINOConstants_js_1.OINO_ERROR_PREFIX + " (" + operation + "): " + statusText;
77
+ this.statusText = OINOConstants_js_1.OINO_ERROR_PREFIX + " (" + operation + "): " + (statusText || "(no status text)");
78
78
  }
79
79
  return this;
80
80
  }
@@ -67,11 +67,11 @@ export class OINOResult {
67
67
  if (this.statusText != "OK") {
68
68
  this.messages.push(this.statusText); // latest error becomes status, but if there was something non-trivial, add it to the messages
69
69
  }
70
- if (statusText.startsWith(OINO_ERROR_PREFIX)) {
70
+ if (statusText && statusText.startsWith(OINO_ERROR_PREFIX)) {
71
71
  this.statusText = statusText;
72
72
  }
73
73
  else {
74
- this.statusText = OINO_ERROR_PREFIX + " (" + operation + "): " + statusText;
74
+ this.statusText = OINO_ERROR_PREFIX + " (" + operation + "): " + (statusText || "(no status text)");
75
75
  }
76
76
  return this;
77
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oino-ts/common",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "OINO TS package for common classes.",
5
5
  "author": "Matias Kiviniemi (pragmatta)",
6
6
  "license": "MPL-2.0",
@@ -19,7 +19,7 @@
19
19
  "dependencies": {
20
20
  },
21
21
  "devDependencies": {
22
- "@oino-ts/types": "1.0.2",
22
+ "@oino-ts/types": "1.0.4",
23
23
  "@types/node": "^22.0.0",
24
24
  "typescript": "~5.9.0"
25
25
  },
package/src/OINOResult.ts CHANGED
@@ -83,10 +83,10 @@ export class OINOResult {
83
83
  if (this.statusText != "OK") {
84
84
  this.messages.push(this.statusText) // latest error becomes status, but if there was something non-trivial, add it to the messages
85
85
  }
86
- if (statusText.startsWith(OINO_ERROR_PREFIX)) {
86
+ if (statusText && statusText.startsWith(OINO_ERROR_PREFIX)) {
87
87
  this.statusText = statusText
88
88
  } else {
89
- this.statusText = OINO_ERROR_PREFIX + " (" + operation + "): " + statusText
89
+ this.statusText = OINO_ERROR_PREFIX + " (" + operation + "): " + (statusText || "(no status text)")
90
90
  }
91
91
  return this
92
92
  }