-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "Cluster not found" error when attaching cluster on target change (…
…#1003) ## Changes * Add onError handler to be able to log errors from lambdas. Use it to catch errors in bundleWatcher.onDidChange callback in bundleValidate. * Remove configure workspace command from the configuration view header. Expose init new project command. * Call disconnect before logging in with saved auth. This allows us to clear any existing auth information (workspace client) * Bring back cluster start stop icons ## Tests <!-- How is this tested? -->
- Loading branch information
1 parent
2af50c6
commit ab4e603
Showing
10 changed files
with
165 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/databricks-vscode/src/utils/EventWithErrorHandler.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import {EventEmitter, Disposable} from "vscode"; | ||
import {OnErrorProps, withOnErrorHandler} from "./onErrorDecorator"; | ||
import lodash from "lodash"; | ||
|
||
export class EventEmitterWithErrorHandler<T> { | ||
private _eventEmitter = new EventEmitter<T>(); | ||
private _event = this._eventEmitter.event; | ||
|
||
constructor(private readonly onErrorDefaults: OnErrorProps = {}) {} | ||
|
||
get event() { | ||
const fn = ( | ||
listener: (e: T) => Promise<unknown>, | ||
opts: { | ||
thisArgs?: any; | ||
disposables?: Disposable[]; | ||
onError?: OnErrorProps; | ||
} = {} | ||
) => { | ||
opts = lodash.merge({}, this.onErrorDefaults, opts); | ||
|
||
return this._event( | ||
withOnErrorHandler(listener, opts.onError), | ||
opts.thisArgs, | ||
opts.disposables | ||
); | ||
}; | ||
|
||
return fn.bind(this); | ||
} | ||
|
||
fire(event: T) { | ||
this._eventEmitter.fire(event); | ||
} | ||
|
||
dispose() { | ||
this._eventEmitter.dispose(); | ||
} | ||
} |
Oops, something went wrong.