Skip to content

Commit

Permalink
fix: "Azure blob storage" error on on premise scenario (microsoft#572)
Browse files Browse the repository at this point in the history
* fix

* - paraphrasing message
  • Loading branch information
alex-krasn authored Sep 11, 2020
1 parent 28c792e commit 46f0bc5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/common/localization/en-us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ export const english: IAppStrings = {
backEndNotAvailable: "Checkbox feature will work in future version of Form Recognizer service, please stay tuned.",
addName: "Add a model name...",
downloadJson: "Download JSON file",
errors: {
electron: {
cantAccessFiles: "Cannot access files in '${folderUri}' for training. Please check if specified folder URI is correct."
}
}

},
modelCompose: {
Expand Down Expand Up @@ -336,7 +341,7 @@ export const english: IAppStrings = {
browse: "Browse",
selectFolder: "Select folder",
chooseFolder: "Choose folder",
invalidFolderMessage: "Connection [${project.sourceConnection.providerOptions.folderPath}] and project folder [${project.folderPath}] are invalid. Please check the specified folders in the Connection and Project Settings pages",
invalidFolderMessage: "Connection [${project.sourceConnection.providerOptions.folderPath}] and/or project folder [${project.folderPath}] are invalid. Please check the specified folders in the Connection and Project Settings pages",
},
},
},
Expand Down
5 changes: 5 additions & 0 deletions src/common/localization/es-cl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ export const spanish: IAppStrings = {
backEndNotAvailable: "La función de casilla de verificación funcionará en la versión futura del servicio de reconocimiento de formularios, manténgase atento.",
addName: "Agregar nombre de modelo ...",
downloadJson: "Descargar archivo JSON",
errors: {
electron: {
cantAccessFiles: "No se puede acceder a los archivos en '${folderUri}' para entrenamiento. Compruebe si el URI de la carpeta especificada es correcto."
}
}
},
modelCompose: {
title: "Modelo componer",
Expand Down
5 changes: 5 additions & 0 deletions src/common/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ export interface IAppStrings {
backEndNotAvailable: string,
addName: string,
downloadJson: string;
errors: {
electron: {
cantAccessFiles: string;
}
}
};
modelCompose: {
title: string,
Expand Down
11 changes: 7 additions & 4 deletions src/react/components/pages/train/trainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import TrainPanel from "./trainPanel";
import TrainTable from "./trainTable";
import { ITrainRecordProps } from "./trainRecord";
import "./trainPage.scss";
import { strings } from "../../../../common/strings";
import { strings, interpolate } from "../../../../common/strings";
import { constants } from "../../../../common/constants";
import _ from "lodash";
import Alert from "../../common/alert/alert";
Expand All @@ -26,6 +26,7 @@ import PreventLeaving from "../../common/preventLeaving/preventLeaving";
import ServiceHelper from "../../../../services/serviceHelper";
import { getPrimaryGreenTheme, getGreenWithWhiteBackgroundTheme } from "../../../../common/themes";
import { getAppInsights } from '../../../../services/telemetryService';
import { isElectron } from "../../../../common/hostProcess";

export interface ITrainPageProps extends RouteComponentProps, React.Props<TrainPage> {
connections: IConnection[];
Expand Down Expand Up @@ -297,11 +298,13 @@ export default class TrainPage extends React.Component<ITrainPageProps, ITrainPa
await this.props.actions.saveProject(updatedProject, false, false);

return trainStatusRes;
} catch (errorMessage) {
} catch (error) {
const isOnPrem = isElectron && this.props.project.sourceConnection.providerType === "localFileSystemProxy";
this.setState({
showTrainingFailedWarning: true,
trainingFailedMessage: (errorMessage !== undefined && errorMessage.message !== undefined
? errorMessage.message : errorMessage),
trainingFailedMessage: isOnPrem ? interpolate(strings.train.errors.electron.cantAccessFiles, { folderUri: this.state.inputtedLabelFolderURL }) :
error?.message !== undefined
? error.message : error,
});
}
}
Expand Down

0 comments on commit 46f0bc5

Please sign in to comment.