Skip to content

Commit

Permalink
Merge pull request #63 from DenisaCG/reorganize
Browse files Browse the repository at this point in the history
Reorganize plugins structure
  • Loading branch information
DenisaCG authored Dec 18, 2024
2 parents cf59e24 + 82eecb8 commit 10412ee
Show file tree
Hide file tree
Showing 12 changed files with 420 additions and 474 deletions.
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

0 comments on commit 10412ee

Please sign in to comment.