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
// an error, and in this case, it would also contain a status code
interface StatusCodeError extends Error {
statusCode?: string;
export interface StatusCodeError extends Error {
statusCode?: string | number;
}
interface CodedSysError extends Error {

View File

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