mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-06-02 15:50:49 +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
|
// 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 {
|
||||||
|
@ -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]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user