Skip to content
This repository was archived by the owner on Jun 14, 2018. It is now read-only.

Standardizing error messages from directives in the console #88

Closed
andrewconnell opened this issue Jan 14, 2016 · 7 comments
Closed

Standardizing error messages from directives in the console #88

andrewconnell opened this issue Jan 14, 2016 · 7 comments
Labels

Comments

@andrewconnell
Copy link
Member

I'm adding some logic to the 'uif-icon' directive to check if the developer requested an invalid icon that isn't supported within the fabric fonts. If they didn't I'm logging an error to the console... Which brings up: how should we standardize this?

Long term I like how angular does it where they link to their site, but that's long term. I think now we just do something like:

'''
Error [ngOfficeUiFabric] fully-qualified-module - error summary: error detail (see more: link to MD file in master branch of repo located within the directive's folder / beside the directive itself)
'''

Seeking input @ngOfficeUIFabric/ngofficeuifabric-members

@s-KaiNet
Copy link
Member

For me all good

@andrewconnell
Copy link
Member Author

Here's how it renders:

image

@jjczopek
Copy link
Contributor

Looks nice. Should we consider this kind of validation for every typed/enumerated option, e.g. in spinner component I can have following logic:

  • if uif-spinner-size="large" - spinner is considered large
  • if uif-spinner-size="small" or uif-spinner-size without value or anything different than small or large, then I render small spinner.

Should I then consider only "small" and "large" as valid and throw error any other?

@ghost
Copy link

ghost commented Jan 14, 2016

Looks good to me too. We will probably need more validation.

@andrewconnell
Copy link
Member Author

@jjczopek Personally I think so... anything that has deterministic options, if one out-of-bounds thing is thrown, it should throw an error in the log.

@waldekmastykarz
Copy link
Member

👍

andrewconnell added a commit that referenced this issue Jan 15, 2016
A new enum is used to verify the specified icon is supported by Office UI Fabric. When an invalid icon is specified, an error is logged to the console. This update also includes a new TypeScript demo.

ref #88
@andrewconnell
Copy link
Member Author

closing the loop... used angular's $log instead of console.log ... the main demo shows it now & you can see it here in dev for now until next drop: https://github.com/ngOfficeUIFabric/ng-officeuifabric/blob/dev/src/components/icon/iconDirective.ts#L69-L74

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants