CheeseLord / warts

WAcky Real Time Strategy
MIT License
1 stars 0 forks source link

Improve names for functions that report bad messages #66

Closed kronmillerg closed 7 years ago

kronmillerg commented 7 years ago

Currently we have the following 4 functions for the given purposes:

unhandledInternalMessage -- unhandled command in internal message
unhandledMessageCommand  -- unhandled command in external message
invalidMessageArgument   -- bad argument in external message
illFormedMessage         -- could not parse string from external source as a message

These names are pretty inconsistent and I don't think any of us can keep straight which is which.

We should instead come up with a naming scheme where the pattern is more clear, and maybe define the obvious other functions to complete the pattern? For example:

illFormedEMessage   -- could not parse external string as message
illFormedIMessage   -- could not parse internal string as message
badEMessageCommand  -- unhandled command in external message
badIMessageCommand  -- unhandled command in internal message
badEMessageArgument -- bad argument in external message
badIMessageArgument -- bad argument in internal message
kronmillerg commented 7 years ago

So the renames should be:

unhandledInternalMessage -> badIMessageCommand
unhandledMessageCommand  -> badEMessageCommand
invalidMessageArgument   -> badEMessageArgument
illFormedMessage         -> illFormedEMessage