Skip to content

Commit

Permalink
naming: FormInitializationError
Browse files Browse the repository at this point in the history
- For now, we’ll go with the name suggested in review. As discussed there, we have broader goals for error reporting, but we can address those in a non-bandaid change (i.e. supporting #202)
- Aligns the module and class name
  • Loading branch information
eyelidlessness committed Oct 16, 2024
1 parent b0b00a0 commit ac5784c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import Dialog from 'primevue/dialog';
import Message from 'primevue/message';
import { computed } from 'vue';
import type { InitializeFormFailure } from '../../lib/error/FormLoadFailure.ts';
import type { FormInitializationError } from '../../lib/error/FormInitializationError.ts';
/**
* @todo translations
Expand All @@ -13,7 +13,7 @@ const FORM_LOAD_ERROR_TEXT = {
};
interface FormLoadErrorProps {
readonly error: InitializeFormFailure;
readonly error: FormInitializationError;
}
const props = defineProps<FormLoadErrorProps>();
Expand Down
6 changes: 3 additions & 3 deletions packages/web-forms/src/components/OdkWebForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Button from 'primevue/button';
import Card from 'primevue/card';
import PrimeMessage from 'primevue/message';
import { computed, provide, reactive, ref, watchEffect, type ComponentPublicInstance } from 'vue';
import { InitializeFormFailure } from '../lib/error/FormLoadFailure.ts';
import { FormInitializationError } from '../lib/error/FormInitializationError.ts';
import FormLoadFailureDialog from './Form/FormLoadFailureDialog.vue';
import FormHeader from './FormHeader.vue';
import QuestionList from './QuestionList.vue';
Expand All @@ -16,7 +16,7 @@ const emit = defineEmits(['submit']);
const odkForm = ref<RootNode>();
const submitPressed = ref(false);
const initializeFormError = ref<InitializeFormFailure | null>();
const initializeFormError = ref<FormInitializationError | null>();
initializeForm(props.formXml, {
config: {
Expand All @@ -27,7 +27,7 @@ initializeForm(props.formXml, {
odkForm.value = f;
})
.catch((cause) => {
initializeFormError.value = new InitializeFormFailure(cause);
initializeFormError.value = new FormInitializationError(cause);
});
const handleSubmit = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ const UNKNOWN_ERROR_MESSAGE = 'Unknown error';
* by {@link JSON.stringify}, we assign that serialization to
* {@link unknownCauseDetail}, in hopes it will provide further clarification
* of unknown failure conditions.
*
* @todo The name of this class may change soon! It may also move up the stack
* to `@getodk/xforms-engine`.
*/
export class InitializeFormFailure extends Error {
export class FormInitializationError extends Error {
readonly unknownCauseDetail: string | null;
readonly stack?: string | undefined;

Expand Down

0 comments on commit ac5784c

Please sign in to comment.