-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with _host.GetAllProjects(true); #28
Labels
Comments
You have a "throw" statement after the "WriteLine" - that may be the
default template VS adds when you create the try/catch. Taking that out
should allow you to skip the project.
The GlobalAnthropologyNotes project type is valid in Paratext, but the
plugin interface is missing a value for this. Maybe we should just add an
"Unknown" type rather than throwing an exception.
I'll check to see what others want to do. The final fix will probably be
both a code change in Paratext and an update to the plugin interface.
John
…On Thu, Feb 23, 2023 at 6:05 PM GeoDirk ***@***.***> wrote:
So I'm running into an exception that I can't get around with the plugin.
Using the following code:
var projects = _host.GetAllProjects(true);
foreach (var project in projects)
{
try
{
var temp = project.Type;
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
}
The above normally works fine for most projects. But we have a user who
has a Paratext project with the settings file of:
<ScriptureText>
<TranslationInfo>GlobalAnthropologyNotes::</TranslationInfo>
<Versification>4</Versification>
<Name>GANed</Name>
<Encoding>65001</Encoding>
<Editable>T</Editable>
<Language>English</Language>
<DefaultFont>Cambria</DefaultFont>
<DefaultFontSize>14</DefaultFontSize>
<FileNamePrePart />
<FileNamePostPart>GANed.SFM</FileNamePostPart>
<FileNameBookNameForm>41MAT</FileNameBookNameForm>
<StyleSheet>usfm.sty</StyleSheet>
<MinParatextVersion>8.0.63.1</MinParatextVersion>
<AssociatedLexicalProject />
<FullName>Global Anthro Notes (edit)</FullName>
<Copyright />
<LanguageIsoCode>en:::</LanguageIsoCode>
<NormalizationForm>NFC</NormalizationForm>
<BiblicalTermsListSetting>Project:EPe1:ProjectBiblicalTerms.xml</BiblicalTermsListSetting>
<AllowReadAccess>F</AllowReadAccess>
<AllowSharingWithSLDR>F</AllowSharingWithSLDR>
<EncodingConverter />
<NeedsEnglishLanguageFix>No</NeedsEnglishLanguageFix>
<NeedsPortugueseLanguageFix>No</NeedsPortugueseLanguageFix>
<Guid>b0bb2a840333b52f197a610822a3f3bb2b441a55</Guid>
<FontFeatures />
<HtmlLanguage />
<Naming PrePart="" PostPart="GANed.SFM" BookNameForm="41MAT" />
</ScriptureText>
When the loop reaches this project, the plugin throws a "ProjectType is
unsupported: GlobalAnthropologyNotes" that I'm not able to catch with the
try/catch{}. Maybe filter out those bad project types from the
GetAllProjects() list?
—
Reply to this email directly, view it on GitHub
<#28>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANSZJWL6YP552Q53P3JGGDWY7UJ7ANCNFSM6AAAAAAVGHE3KM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Or perhaps "Unsupported" (since it is known, but plugins can't do anything
useful with them).
…On Thu, Mar 2, 2023 at 11:49 AM jwickberg ***@***.***> wrote:
You have a "throw" statement after the "WriteLine" - that may be the
default template VS adds when you create the try/catch. Taking that out
should allow you to skip the project.
The GlobalAnthropologyNotes project type is valid in Paratext, but the
plugin interface is missing a value for this. Maybe we should just add an
"Unknown" type rather than throwing an exception.
I'll check to see what others want to do. The final fix will probably be
both a code change in Paratext and an update to the plugin interface.
John
On Thu, Feb 23, 2023 at 6:05 PM GeoDirk ***@***.***> wrote:
> So I'm running into an exception that I can't get around with the plugin.
> Using the following code:
>
> var projects = _host.GetAllProjects(true);
> foreach (var project in projects)
> {
> try
> {
> var temp = project.Type;
> }
> catch (Exception e)
> {
> Console.WriteLine(e);
> throw;
> }
> }
>
> The above normally works fine for most projects. But we have a user who
> has a Paratext project with the settings file of:
>
> <ScriptureText>
> <TranslationInfo>GlobalAnthropologyNotes::</TranslationInfo>
> <Versification>4</Versification>
> <Name>GANed</Name>
> <Encoding>65001</Encoding>
> <Editable>T</Editable>
> <Language>English</Language>
> <DefaultFont>Cambria</DefaultFont>
> <DefaultFontSize>14</DefaultFontSize>
> <FileNamePrePart />
> <FileNamePostPart>GANed.SFM</FileNamePostPart>
> <FileNameBookNameForm>41MAT</FileNameBookNameForm>
> <StyleSheet>usfm.sty</StyleSheet>
> <MinParatextVersion>8.0.63.1</MinParatextVersion>
> <AssociatedLexicalProject />
> <FullName>Global Anthro Notes (edit)</FullName>
> <Copyright />
> <LanguageIsoCode>en:::</LanguageIsoCode>
> <NormalizationForm>NFC</NormalizationForm>
>
<BiblicalTermsListSetting>Project:EPe1:ProjectBiblicalTerms.xml</BiblicalTermsListSetting>
> <AllowReadAccess>F</AllowReadAccess>
> <AllowSharingWithSLDR>F</AllowSharingWithSLDR>
> <EncodingConverter />
> <NeedsEnglishLanguageFix>No</NeedsEnglishLanguageFix>
> <NeedsPortugueseLanguageFix>No</NeedsPortugueseLanguageFix>
> <Guid>b0bb2a840333b52f197a610822a3f3bb2b441a55</Guid>
> <FontFeatures />
> <HtmlLanguage />
> <Naming PrePart="" PostPart="GANed.SFM" BookNameForm="41MAT" />
> </ScriptureText>
>
> When the loop reaches this project, the plugin throws a "ProjectType is
> unsupported: GlobalAnthropologyNotes" that I'm not able to catch with the
> try/catch{}. Maybe filter out those bad project types from the
> GetAllProjects() list?
>
> —
> Reply to this email directly, view it on GitHub
> <#28>, or
> unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AANSZJWL6YP552Q53P3JGGDWY7UJ7ANCNFSM6AAAAAAVGHE3KM
>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABAITXX6MCLFGDO775M5BULW2DFTFANCNFSM6AAAAAAVGHE3KM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
FoolRunning
added
bug
Something isn't working
enhancement
New feature or request
labels
Apr 24, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So I'm running into an exception that I can't get around with the plugin. Using the following code:
The above normally works fine for most projects. But we have a user who has a Paratext project with the settings file of:
When the loop reaches this project, the plugin throws a "ProjectType is unsupported: GlobalAnthropologyNotes" that I'm not able to catch with the try/catch{}. Maybe filter out those bad project types from the
GetAllProjects()
list?The text was updated successfully, but these errors were encountered: