Improve error and logger typings

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2019-01-24 16:50:40 +00:00
parent ecffa12e41
commit e5893c0ee0
No known key found for this signature in database
GPG Key ID: 49690ED87032539F
2 changed files with 4 additions and 4 deletions

View File

@ -5,8 +5,8 @@ import { checkInt } from './validation';
// To keep the bluebird typings happy, we need to accept // To keep the bluebird typings happy, we need to accept
// an error, and in this case, it would also contain a status code // an error, and in this case, it would also contain a status code
interface StatusCodeError extends Error { export interface StatusCodeError extends Error {
statusCode?: string; statusCode?: string | number;
} }
interface CodedSysError extends Error { interface CodedSysError extends Error {

View File

@ -134,7 +134,7 @@ export class Logger {
public attach( public attach(
docker: Docker, docker: Docker,
containerId: string, containerId: string,
serviceInfo: { serviceId: string; imageId: string }, serviceInfo: { serviceId: number; imageId: number },
): Bluebird<void> { ): Bluebird<void> {
return Bluebird.using(this.lock(containerId), () => { return Bluebird.using(this.lock(containerId), () => {
return this.attachStream( return this.attachStream(
@ -199,7 +199,7 @@ export class Logger {
docker: Docker, docker: Docker,
streamType: OutputStream, streamType: OutputStream,
containerId: string, containerId: string,
{ serviceId, imageId }: { serviceId: string; imageId: string }, { serviceId, imageId }: { serviceId: number; imageId: number },
): Bluebird<void> { ): Bluebird<void> {
return Bluebird.try(() => { return Bluebird.try(() => {
if (this.attached[streamType][containerId]) { if (this.attached[streamType][containerId]) {