Skip to content

Commit

Permalink
Added logging (#32)
Browse files Browse the repository at this point in the history
* Added logging

* Changelog
  • Loading branch information
chrsmutti authored Feb 14, 2020
1 parent 16596f9 commit 4f6c005
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- Logging in `node` builder.

## [0.6.14] - 2020-02-14

### Changed
Expand Down
8 changes: 4 additions & 4 deletions node/clients/biggy-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class BiggySearchClient extends ExternalClient {

return result || { searches: [] };
} catch (err) {
// TODO: Add logging
this.context.logger.error(err);
return { searches: [] };
}
}
Expand All @@ -48,7 +48,7 @@ export class BiggySearchClient extends ExternalClient {

return result || { searches: [] };
} catch (err) {
// TODO: Add logging
this.context.logger.error(err);
return { searches: [] };
}
}
Expand Down Expand Up @@ -94,7 +94,7 @@ export class BiggySearchClient extends ExternalClient {

return result || { count: 0, products: [] };
} catch (err) {
// TODO: Add logging
this.context.logger.error(err);
return { count: 0, products: [] };
}
}
Expand Down Expand Up @@ -135,7 +135,7 @@ export class BiggySearchClient extends ExternalClient {
redirect = path(["response", "headers", "location"], err);
}

// TODO: Add logging
this.context.logger.error(err);
return {
redirect,
query,
Expand Down
1 change: 1 addition & 0 deletions node/clients/search-graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class SearchGraphQL extends AppGraphQLClient {

return pathOr<any[]>([], ["data", "productsByIdentifier"], result);
} catch (err) {
this.context.logger.error(err);
return [];
}
};
Expand Down
2 changes: 1 addition & 1 deletion node/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ClientsConfig, Service, IOContext } from "@vtex/api";
import { Clients } from "./clients";
import { schemaDirectives } from './directives'
import { schemaDirectives } from "./directives";
import { autocomplete } from "./resolvers/autocomplete";
import { search } from "./resolvers/search";
import { extraInfo } from "./resolvers/extra-info";
Expand Down

0 comments on commit 4f6c005

Please sign in to comment.