Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions src/drivesError.ts

This file was deleted.

35 changes: 33 additions & 2 deletions src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { URLExt } from '@jupyterlab/coreutils';
import { ServerConnection } from '@jupyterlab/services';
import { ReadonlyJSONObject } from '@lumino/coreutils';

import { DrivesResponseError } from './drivesError';

/**
* Array of Jupyter Drives Auth Error Messages.
*/
Expand All @@ -15,6 +13,39 @@ export const AUTH_ERROR_MESSAGES = [
'Authentication error'
];

/**
* A wrapped error for a fetch response.
*/
export class DrivesResponseError extends ServerConnection.ResponseError {
/**
* Create a new response error.
*/
constructor(
response: Response,
message = `Invalid response: ${response.status} ${response.statusText}`,
traceback = '',
json: ReadonlyJSONObject | null = {}
) {
super(response, message);
this.traceback = traceback; // traceback added in mother class in 2.2.x
this._json = json ?? {};
}

/**
* The error response JSON body
*/
get json(): ReadonlyJSONObject {
return this._json;
}

/**
* The traceback associated with the error.
*/
traceback: string;

protected _json: ReadonlyJSONObject;
}

/**
* Call the API extension
*
Expand Down
6 changes: 0 additions & 6 deletions src/icons.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { LabIcon } from '@jupyterlab/ui-components';
import driveSvgstr from '../style/drive.svg';
import driveBrowserSvg from '../style/driveIconFileBrowser.svg';

export const DriveIcon = new LabIcon({
name: 'jupyter-drives:drive',
svgstr: driveSvgstr
});

export const driveBrowserIcon = new LabIcon({
name: 'jupyter-drives:drive-browser',
svgstr: driveBrowserSvg
Expand Down
Loading
Loading