User:Johnuniq/Convert messages

Old message format
This section uses the wikitext that the module used to output.

Module:Convert can output various error and warning messages. Following is a quick wikification of the output of a test I run on a local computer. This is to give an overview for anyone interested in improving these messages. Also see Template:Convert/testcases/bytype/warnings.

One issue is the ugly orange color intended to give a very clear indication that something needs to be fixed. The current format follows, with an alternative that was specified for another project: Whatever is wanted is fine with me.
 * → Example output text
 * → Example output text

I should remove the tracking categories from this page. Will do that another time. [done] I'm not sure where to invite comments, perhaps Module talk:Convert? Anywhere, including on this page, is fine. Johnuniq (talk) 02:59, 20 September 2013 (UTC)

Using "|test=msg" causes Module:Convert to patch the units table to make invalid defaults.
 * → Conversion error: Unit "chain" has no default output unit
 * → Conversion error: Unit "rd" has an invalid default


 * → Conversion error: Need value
 * → Conversion error: Need value
 * → Conversion error: Need value
 * → Conversion error: Value "x" must be a number
 * → Conversion error: Need name of unit
 * → Conversion error: Number is too large or too small


 * → Conversion error: Use  (not  )


 * → Conversion error: Unit "ftin" is invalid here


 * → Conversion error: Unit "xyz" is not known


 * → Conversion error: Value "ft" must be a number
 * → Conversion error: Value "ft" must be a number


 * → Conversion error: Value "*12" must be a number
 * → Conversion error: Value "1.*2" must be a number
 * → Conversion error: Value "*34" must be a number
 * → Conversion error: Value "3.*4" must be a number


 * → Conversion error: Parameter precision "1.5" must be an integer


 * → Conversion error: Cannot convert "length" to "mass"


 * → Conversion error: Use  (not  )
 * → Conversion error: Use  (not  )
 * → Conversion error: Use  for US gallons or   for imperial gallons (not  )
 * → Conversion error: Use  for US gallons or   for imperial gallons (not  )
 * → Conversion error: Use  (not  )
 * → Conversion error: Use  (not  )
 * → Conversion error: Use  (not  )
 * → Conversion error: Use  (not  )
 * → Conversion error: Use  (not  )
 * → Conversion error: Use  (not  )
 * → Conversion error: Use  (not  )
 * → Conversion error: Use  for miles per US gallon or   for miles per imperial gallon (not  )
 * → Conversion error: Use  for US pints or   for imperial pints (not  )
 * → Conversion error: Use  for US quarts or   for imperial quarts (not  )
 * → Conversion error: Use  (not  )

Precision too big (positive and negative).
 * → Conversion error: Precision "999" is too large
 * → 123 metres (0 m)

Option warnings.
 * → Conversion warning: Ignored invalid option "junk="
 * → Conversion warning: Ignored invalid option "junk=on"
 * → Conversion warning: Ignored invalid option "adj=junk"
 * → Conversion warning: Ignored empty option "adj"

Option warnings while mixing adj + sing (sing is an alias for adj).
 * → 123-metre (404 ft)
 * → 123-metre (404 ft)
 * → 123-metre (404 ft) Conversion warning: Ignored invalid option "adj"
 * → 123 metres (404 ft) Conversion warning: Ignored invalid option "adj"
 * → 123 metres (404 ft) Conversion warning: Ignored invalid option "adj"
 * → 123-metre (404 ft) Conversion warning: Ignored invalid option "adj"

Sigfig.
 * → 123 millimetres (4.84 in)
 * → 123 millimetres (4.8 in) Conversion warning: Ignored empty option "sigfig"
 * → 123 millimetres (4.8 in) Conversion warning: Ignored empty option "sigfig"
 * → Conversion error: Parameter sigfig "-1" must be a positive integer
 * → Conversion error: Parameter sigfig "0" must be a positive integer
 * → Conversion error: Parameter sigfig "1.5" must be a positive integer
 * → Conversion error: Parameter sigfig "bogus" must be a positive integer

Sortable ("sortable=off" is not an error).
 * → 123 millimetres (4.8 in)
 * → 123 millimetres (4.8 in) Conversion warning: Ignored empty option "sortable"
 * → 123 millimetres (4.8 in) Conversion warning: Ignored invalid option "sortable=bogus"
 * → 123 millimetres (4.8 in)
 * → 7002123000000000000 123 millimetres (4.8 in)
 * → 7002123000000000000 123 millimetres (4.8 in)
 * → 7002123000000000000 123 millimetres (4.8 in) Conversion warning: Ignored invalid option "debug=y"

Dimension mismatch errors.
 * → Conversion error: Cannot convert "acceleration" to "area"
 * → Conversion error: Cannot convert "area per unit area" to "charge"
 * → Conversion error: Cannot convert "chemical amount" to "co2 per unit volume"
 * → Conversion error: Cannot convert "cost $ per unit area" to "cost $ per unit mass"
 * → Conversion error: Cannot convert "cost £ per unit area" to "density"
 * → Conversion error: Cannot convert "energy" to "energy per unit length"
 * → Conversion error: Cannot convert "energy per unit mass" to "energy per unit volume"
 * → Conversion error: Cannot convert "exhaust emission" to "flow"
 * → Conversion error: Cannot convert "force" to "fuel efficiency"
 * → Conversion error: Cannot convert "fracture gradient" to "gradient"
 * → Conversion error: Cannot convert "length" to "linear density"
 * → Conversion error: Cannot convert "mass" to "mass per unit area"
 * → Conversion error: Cannot convert "mass per unit power" to "mass per unit time"
 * → Conversion error: Cannot convert "molar rate" to "per unit area"
 * → Conversion error: Cannot convert "per unit volume" to "population density"
 * → Conversion error: Cannot convert "power" to "power per unit mass"
 * → Conversion error: Cannot convert "pressure" to "radioactivity"
 * → Conversion error: Cannot convert "speed" to "temperature"
 * → Conversion error: Cannot convert "temperature change" to "thrust specific fuel consumption"
 * → Conversion error: Cannot convert "time" to "torque"
 * → Conversion error: Cannot convert "volume" to "volume per unit area"

New message format
This section uses the live sandboxlua template to show output from the current module (the visible text says "convert", but it is calling convert/sandboxlua2).

Using "|test=msg" causes Module:Convert to patch the units table to make invalid defaults.



















Precision too big (positive and negative).

Option warnings.

Option warnings while mixing adj + sing (sing is an alias for adj).

Sigfig.

Sortable ("sortable=off" is not an error).

Dimension mismatch errors.