@voxgig/sdkgen 3.3.1 → 3.3.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voxgig/sdkgen",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "main": "dist/sdkgen.js",
5
5
  "type": "commonjs",
6
6
  "engines": {
@@ -47,7 +47,7 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
47
47
  // A direct()-only SDK (no ops anywhere) shows a direct() call instead.
48
48
  const testModeExample = primaryOp
49
49
  ? `# Entity ops return the ENTITY and dies on error;
50
- // call data_get for the record.
50
+ # call data_get for the record.
51
51
  my $${eVar} = $client->${eName}->${primaryOp}(${testArg});
52
52
  # $${eVar} contains the mock response record`
53
53
  : `my $result = $client->direct({ 'path' => '/api/resource', 'method' => 'GET' });
@@ -55,7 +55,7 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
55
55
  // A direct()-only SDK (no ops anywhere) shows a direct() call instead.
56
56
  const testModeExample = primaryOp
57
57
  ? `# Entity ops return the ENTITY and raises on error;
58
- // call data_get() for the record.
58
+ # call data_get() for the record.
59
59
  ${eVar} = client.${eName}().${primaryOp}(${testArg})
60
60
  # ${eVar} contains the mock response record`
61
61
  : `result = client.direct({"path": "/api/resource", "method": "GET"})
@@ -66,7 +66,7 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
66
66
  // A direct()-only SDK (no ops anywhere) shows a direct() call instead.
67
67
  const testModeExample = primaryOp
68
68
  ? `# Entity ops return the ENTITY (raises on error);
69
- // call data_get for the mock record.
69
+ # call data_get for the mock record.
70
70
  ${eVar} = client.${eName}.${primaryOp}(${testCallArg})
71
71
  puts ${eVar}`
72
72
  : `result = client.direct({ "path" => "/api/resource", "method" => "GET" })
@@ -1,7 +1,7 @@
1
1
  # ProjectName SDK error
2
2
 
3
3
  class ProjectNameError < StandardError
4
- attr_accessor :is_sdk_error, :sdk, :code, :msg, :ctx, :result, :spec
4
+ attr_accessor :is_sdk_error, :sdk, :code, :msg, :ctx, :result, :spec, :status
5
5
 
6
6
  def initialize(code = "", msg = "", ctx = nil)
7
7
  super(msg)
@@ -12,6 +12,11 @@ class ProjectNameError < StandardError
12
12
  @ctx = ctx
13
13
  @result = nil
14
14
  @spec = nil
15
+ # make_error promotes the HTTP status here so a consumer can branch on
16
+ # `err.status` without reaching into `err.result`. Ruby needs the
17
+ # accessor declared: unlike Python or Lua, assigning an undeclared
18
+ # attribute is a NoMethodError, not a new field.
19
+ @status = -1
15
20
  end
16
21
 
17
22
  def error