mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-04-14 14:36:36 +00:00
Improve error and logger typings
Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
ecffa12e41
commit
e5893c0ee0
@ -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 {
|
||||
|
@ -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]) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user