Skip to content

Commit 10412ee

Browse files
authored
Merge pull request #63 from DenisaCG/reorganize
Reorganize plugins structure
2 parents cf59e24 + 82eecb8 commit 10412ee

File tree

12 files changed

+420
-474
lines changed

12 files changed

+420
-474
lines changed

src/drivesError.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/handler.ts

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { URLExt } from '@jupyterlab/coreutils';
22
import { ServerConnection } from '@jupyterlab/services';
33
import { ReadonlyJSONObject } from '@lumino/coreutils';
44

5-
import { DrivesResponseError } from './drivesError';
6-
75
/**
86
* Array of Jupyter Drives Auth Error Messages.
97
*/
@@ -15,6 +13,39 @@ export const AUTH_ERROR_MESSAGES = [
1513
'Authentication error'
1614
];
1715

16+
/**
17+
* A wrapped error for a fetch response.
18+
*/
19+
export class DrivesResponseError extends ServerConnection.ResponseError {
20+
/**
21+
* Create a new response error.
22+
*/
23+
constructor(
24+
response: Response,
25+
message = `Invalid response: ${response.status} ${response.statusText}`,
26+
traceback = '',
27+
json: ReadonlyJSONObject | null = {}
28+
) {
29+
super(response, message);
30+
this.traceback = traceback; // traceback added in mother class in 2.2.x
31+
this._json = json ?? {};
32+
}
33+
34+
/**
35+
* The error response JSON body
36+
*/
37+
get json(): ReadonlyJSONObject {
38+
return this._json;
39+
}
40+
41+
/**
42+
* The traceback associated with the error.
43+
*/
44+
traceback: string;
45+
46+
protected _json: ReadonlyJSONObject;
47+
}
48+
1849
/**
1950
* Call the API extension
2051
*

src/icons.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import { LabIcon } from '@jupyterlab/ui-components';
2-
import driveSvgstr from '../style/drive.svg';
32
import driveBrowserSvg from '../style/driveIconFileBrowser.svg';
43

5-
export const DriveIcon = new LabIcon({
6-
name: 'jupyter-drives:drive',
7-
svgstr: driveSvgstr
8-
});
9-
104
export const driveBrowserIcon = new LabIcon({
115
name: 'jupyter-drives:drive-browser',
126
svgstr: driveBrowserSvg

0 commit comments

Comments
 (0)