* robust exit

* regen

* title lingo
This commit is contained in:
Johannes Bader 2018-01-19 12:54:09 -08:00 коммит произвёл GitHub
Родитель d897ff4867
Коммит b95f5d19cb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
11 изменённых файлов: 25 добавлений и 23 удалений

Просмотреть файл

@ -6,4 +6,4 @@ ERROR: Schema violation: Data does not match any schemas from 'anyOf'
ERROR: Schema violation: Data does not match any schemas from 'oneOf'
FATAL: Error: [OperationAbortedException] Error occurred. Exiting.
FATAL: swagger-document/individual/schema-validator - FAILED
Process() Cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.
Process() cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.

Просмотреть файл

@ -1,2 +1,2 @@
https://aka.ms/autorest
Process() Cancelled due to exception : Syntax errors encountered.
Process() cancelled due to exception : Syntax errors encountered.

Просмотреть файл

@ -8,4 +8,4 @@ ERROR: Syntax Error Encountered: Syntax error: bad indentation of a mapping entr
ERROR: Syntax Error Encountered: Syntax error: incomplete explicit mapping pair; a key node is missed
FATAL: Error: [OperationAbortedException] Error occurred. Exiting.
FATAL: swagger-document/loader - FAILED
Process() Cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.
Process() cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.

Просмотреть файл

@ -1,2 +1,2 @@
https://aka.ms/autorest
Process() Cancelled due to exception : File '/Samples/test/error-behavior/openapi-not-swagger/tiny.json' is not a valid OpenAPI 2.0 definition (expected 'swagger: 2.0')
Process() cancelled due to exception : File '/Samples/test/error-behavior/openapi-not-swagger/tiny.json' is not a valid OpenAPI 2.0 definition (expected 'swagger: 2.0')

Просмотреть файл

@ -2,4 +2,4 @@
ERROR: Referenced file '/Samples/test/error-behavior/openapi-yaml-bad-file-reference/i-do-not-exist.json' not found
FATAL: Error: [OperationAbortedException] Error occurred. Exiting.
FATAL: swagger-document/loader - FAILED
Process() Cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.
Process() cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.

Просмотреть файл

@ -1,2 +1,2 @@
https://aka.ms/autorest
Process() Cancelled due to exception : Could not resolve reference #/definitions/Cowball
Process() cancelled due to exception : Could not resolve reference #/definitions/Cowball

Просмотреть файл

@ -1,2 +1,2 @@
https://aka.ms/autorest
Process() Cancelled due to exception : Syntax errors encountered.
Process() cancelled due to exception : Syntax errors encountered.

Просмотреть файл

@ -1,2 +1,2 @@
https://aka.ms/autorest
Process() Cancelled due to exception : Plugin imodeler1 reported failure.
Process() cancelled due to exception : Plugin imodeler1 reported failure.

Просмотреть файл

@ -137,7 +137,7 @@ export class AutoRest extends EventEmitter {
view.messageEmitter.removeAllListeners();
return true;
} catch (e) {
const message = { Channel: Channel.Debug, Text: `Process() Cancelled due to exception : ${e.message}` };
const message = { Channel: Channel.Debug, Text: `Process() cancelled due to exception : ${e.message}` };
if (e instanceof Exception) {
// idea: don't throw exceptions, just visibly log them and return false
message.Channel = Channel.Fatal;

Просмотреть файл

@ -606,23 +606,25 @@ export class Configuration {
}
public static async shutdown() {
AutoRestExtension.killAll();
try {
AutoRestExtension.killAll();
// once we shutdown those extensions, we should shutdown the EM too.
const extMgr = await Configuration.extensionManager;
extMgr.dispose();
// once we shutdown those extensions, we should shutdown the EM too.
const extMgr = await Configuration.extensionManager;
extMgr.dispose();
// but if someone goes to use that, we're going to need a new instance (since the shared lock will be gone in the one we disposed.)
Configuration.extensionManager = new LazyPromise<ExtensionManager>(() => ExtensionManager.Create(join(process.env["autorest.home"] || require("os").homedir(), ".autorest")))
// but if someone goes to use that, we're going to need a new instance (since the shared lock will be gone in the one we disposed.)
Configuration.extensionManager = new LazyPromise<ExtensionManager>(() => ExtensionManager.Create(join(process.env["autorest.home"] || require("os").homedir(), ".autorest")))
for (const each in loadedExtensions) {
const ext = loadedExtensions[each];
if (ext.autorestExtension.hasValue) {
const extension = await ext.autorestExtension;
extension.kill();
delete loadedExtensions[each];
for (const each in loadedExtensions) {
const ext = loadedExtensions[each];
if (ext.autorestExtension.hasValue) {
const extension = await ext.autorestExtension;
extension.kill();
delete loadedExtensions[each];
}
}
}
} catch { }
}
public async CreateView(messageEmitter: MessageEmitter, includeDefault: boolean, ...configs: Array<any>): Promise<ConfigurationView> {

Просмотреть файл

@ -350,7 +350,7 @@ export async function ComposeSwaggers(config: ConfigurationView, overrideInfoTit
const uniqueVersion: boolean = distinct(inputSwaggerObjects.map(s => s.info).filter(i => !!i).map(i => i.version)).length === 1;
if (candidateTitles.length === 0) throw new Error(`No 'title' in provided OpenAPI definition(s).`);
if (candidateTitles.length > 1) throw new Error(`No unique 'title' across OpenAPI definitions: ${candidateTitles.map(x => `'${x}'`).join(", ")}. Please adjust or provide an override.`);
if (candidateTitles.length > 1) throw new Error(`The 'title' across provided OpenAPI definitions has to match. Found: ${candidateTitles.map(x => `'${x}'`).join(", ")}. Please adjust or provide an override (--title=...).`);
if (candidateDescriptions.length !== 1) candidateDescriptions.splice(0, candidateDescriptions.length);
// prepare component Swaggers (override info, lift version param, ...)