Skip to content

Conversation

Aschen
Copy link
Contributor

@Aschen Aschen commented Aug 12, 2020

What does this PR do?

Keep the stacktrace from the client side instead of using Kuzzle's one

Before

NotFoundError: Controller action "valt" not found.
[...Kuzzle internal calls deleted...]
    at Funnel.getController (/home/aschen/projets/kuzzleio/kuzzle/lib/api/funnel.js:582:28)
    at Funnel.processRequest (/home/aschen/projets/kuzzleio/kuzzle/lib/api/funnel.js:400:29)
    at /home/aschen/projets/kuzzleio/kuzzle/lib/api/funnel.js:282:23

After

KuzzleError: Controller action "valt" not found.
    at WebSocketProtocol.query (/home/aschen/projets/kuzzleio/sdk-javascript/src/protocols/abstract/Base.ts:112:19)
    at Proxy.query (/home/aschen/projets/kuzzleio/sdk-javascript/src/Kuzzle.ts:516:26)
 🡆  at run (/home/aschen/projets/kuzzleio/sdk-javascript/test.js:10:30)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

fix #539

How should this be manually tested?

const { Kuzzle, WebSocket } = require('./index')

const kuzzle = new Kuzzle(new WebSocket('localhost'))

kuzzle.on('networkError', error => console.log(error));

const run = async () => {
  await kuzzle.connect();
  try {
    console.log(await kuzzle.query({
      controller: 'tests',
      action: 'valt'
    }))
  }
  catch (error) {
    console.log(error)
  }
};

run();

@Aschen Aschen changed the base branch from master to 7-dev August 12, 2020 13:59
@Aschen Aschen changed the title 539 meaningful stacktrace Add meaningful stacktrace Aug 12, 2020
@Aschen Aschen self-assigned this Aug 12, 2020
@codecov
Copy link

codecov bot commented Aug 13, 2020

Codecov Report

Merging #541 into 7-dev will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            7-dev     #541      +/-   ##
==========================================
+ Coverage   88.34%   88.40%   +0.06%     
==========================================
  Files          32       32              
  Lines        1441     1449       +8     
  Branches      249      251       +2     
==========================================
+ Hits         1273     1281       +8     
  Misses        119      119              
  Partials       49       49              
Impacted Files Coverage Δ
src/KuzzleError.ts 100.00% <100.00%> (ø)
src/protocols/abstract/Base.ts 91.66% <100.00%> (+0.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 58b6bdb...2b52651. Read the comment docs.

@Aschen Aschen merged commit 340159f into 7-dev Aug 18, 2020
@Aschen Aschen deleted the 539-meaningful-stacktrace branch August 18, 2020 12:08
This was referenced Aug 18, 2020
Aschen added a commit that referenced this pull request Aug 18, 2020
# [7.4.0](https://github.com/kuzzleio/sdk-javascript/releases/tag/7.4.0) (2020-08-18)


#### New features

- [ [#542](#542) ] Finalize typescript support   ([Aschen](https://github.com/Aschen))
- [ [#529](#529) ] Add typescript support for protocols   ([Aschen](https://github.com/Aschen))

#### Enhancements

- [ [#541](#541) ] Add meaningful stacktrace   ([Aschen](https://github.com/Aschen))
- [ [#537](#537) ] Add typescript support realtime   ([Aschen](https://github.com/Aschen))
- [ [#531](#531) ] Add typescript support for Index and Collection controllers   ([Aschen](https://github.com/Aschen))
- [ [#530](#530) ] Add typescript support for search results   ([Aschen](https://github.com/Aschen))
- [ [#523](#523) ] Add support for the collection:delete API action   ([morgandruesne](https://github.com/morgandruesne))
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors don't include a valid stack
2 participants