mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 01:32:34 -05:00
Add more areas to strict null (#7243)
* add more areas to strict null * fix compile errors * fix tests * fix checks * address PR comments
This commit is contained in:
@@ -32,7 +32,7 @@ let prevSavePath: string;
|
||||
|
||||
export interface SaveResultsResponse {
|
||||
succeeded: boolean;
|
||||
messages: string;
|
||||
messages?: string;
|
||||
}
|
||||
|
||||
interface ICsvConfig {
|
||||
@@ -94,7 +94,7 @@ export class ResultSerializer {
|
||||
/**
|
||||
* Handle save request by getting filename from user and sending request to service
|
||||
*/
|
||||
public handleSerialization(uri: string, format: SaveFormat, sendRequest: ((filePath: string) => Promise<SaveResultsResponse>)): Thenable<void> {
|
||||
public handleSerialization(uri: string, format: SaveFormat, sendRequest: ((filePath: string) => Promise<SaveResultsResponse | undefined>)): Thenable<void> {
|
||||
const self = this;
|
||||
return this.promptForFilepath(format, uri).then(filePath => {
|
||||
if (filePath) {
|
||||
@@ -103,7 +103,7 @@ export class ResultSerializer {
|
||||
}
|
||||
return self.doSave(filePath, format, () => sendRequest(filePath));
|
||||
}
|
||||
return Promise.resolve(undefined);
|
||||
return Promise.resolve();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -331,19 +331,19 @@ export class ResultSerializer {
|
||||
/**
|
||||
* Send request to sql tools service to save a result set
|
||||
*/
|
||||
private async doSave(filePath: string, format: string, sendRequest: () => Promise<SaveResultsResponse>): Promise<void> {
|
||||
private async doSave(filePath: string, format: string, sendRequest: () => Promise<SaveResultsResponse | undefined>): Promise<void> {
|
||||
|
||||
this.logToOutputChannel(LocalizedConstants.msgSaveStarted + filePath);
|
||||
|
||||
// send message to the sqlserverclient for converting results to the requested format and saving to filepath
|
||||
try {
|
||||
let result = await sendRequest();
|
||||
if (result.messages) {
|
||||
if (!result || result.messages) {
|
||||
this._notificationService.notify({
|
||||
severity: Severity.Error,
|
||||
message: LocalizedConstants.msgSaveFailed + result.messages
|
||||
message: LocalizedConstants.msgSaveFailed + (result ? result.messages : '')
|
||||
});
|
||||
this.logToOutputChannel(LocalizedConstants.msgSaveFailed + result.messages);
|
||||
this.logToOutputChannel(LocalizedConstants.msgSaveFailed + (result ? result.messages : ''));
|
||||
} else {
|
||||
this.promptFileSavedNotification(filePath);
|
||||
this.logToOutputChannel(LocalizedConstants.msgSaveSucceeded + filePath);
|
||||
|
||||
Reference in New Issue
Block a user